2021-11-30 14:32:10 +01:00
|
|
|
using Microsoft.AspNetCore.Diagnostics;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
2021-12-01 13:03:06 +01:00
|
|
|
namespace zero.Api.Endpoints.Error;
|
2021-11-30 14:32:10 +01:00
|
|
|
|
|
|
|
|
public class ErrorController : ZeroApiController
|
|
|
|
|
{
|
|
|
|
|
[HttpGet("")]
|
|
|
|
|
public virtual ActionResult<ApiResponse> Index()
|
|
|
|
|
{
|
|
|
|
|
return new ErrorApiResponse()
|
|
|
|
|
{
|
|
|
|
|
Success = false,
|
2021-12-13 12:21:15 +01:00
|
|
|
Status = HttpContext.Response.StatusCode
|
2021-11-30 14:32:10 +01:00
|
|
|
};
|
2021-12-13 12:21:15 +01:00
|
|
|
|
|
|
|
|
//IExceptionHandlerFeature exception = HttpContext.Features.Get<IExceptionHandlerFeature>();
|
|
|
|
|
|
|
|
|
|
//return new ErrorApiResponse()
|
|
|
|
|
//{
|
|
|
|
|
// Success = false,
|
|
|
|
|
// Status = HttpContext.Response.StatusCode,
|
|
|
|
|
// Error = new()
|
|
|
|
|
// {
|
|
|
|
|
// ApiPath = exception.Path,
|
|
|
|
|
// Message = exception.Error.Message
|
|
|
|
|
// }
|
|
|
|
|
//};
|
2021-11-30 14:32:10 +01:00
|
|
|
}
|
|
|
|
|
}
|