private void SetCommonBadRequestProblemDetails(IExceptionHandlerFeature errorFeature, HttpContext context, string detail, params string[] errorMessages) { Detail = detail; Instance = errorFeature.GetInstance(); Extensions.TryAdd("errors", errorMessages); Extensions.TryAdd("traceId", Activity.Current?.Id ?? context.TraceIdentifier); }
public UnhandledExceptionProblemDetails(Exception ex, IExceptionHandlerFeature errorFeature, HttpContext context) : base(StatusCodes.Status500InternalServerError) { Detail = "An unhandled exception has occured"; Instance = errorFeature.GetInstance(); Extensions.TryAdd("errors", ex.Message); Extensions.TryAdd("traceId", Activity.Current?.Id ?? context.TraceIdentifier); }