Skip to content

Commit 39d3ba0

Browse files
committed
500 Error response
500 error response added
1 parent 5f82b83 commit 39d3ba0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Net;
5+
6+
namespace Supermarket.ApiResponse
7+
{
8+
public class InternalServerErrorResponse : ValidationProblemDetails
9+
{
10+
public Guid TraceId { get; set; }
11+
12+
public InternalServerErrorResponse(string error) : base(new Dictionary<string, string[]> { { "error", new[] { error } } })
13+
{
14+
TraceId = Guid.NewGuid();
15+
Title = HttpStatusCode.InternalServerError.ToString();
16+
Status = (int)HttpStatusCode.InternalServerError;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)