1- using System ;
2- using ExceptionAll . Dtos ;
3- using ExceptionAll . Helpers ;
4- using Microsoft . AspNetCore . Http ;
5- using Microsoft . AspNetCore . Mvc ;
6- using Microsoft . AspNetCore . Mvc . Filters ;
7- using System . Collections . Generic ;
1+ namespace ExceptionAll . Details ;
82
9- namespace ExceptionAll . Details
3+ public class InternalServerErrorDetails : BaseDetails
104{
11- public class InternalServerErrorDetails : ProblemDetails
5+ public InternalServerErrorDetails ( ActionContext context , string title = null , string message = null , List < ErrorDetail > errors = null ) :
6+ base (
7+ context ?? throw new ArgumentNullException ( nameof ( context ) ) ,
8+ string . IsNullOrEmpty ( title ) ? "Internal Server Error" : title ,
9+ context . HttpContext . Request . Path ,
10+ StatusCodes . Status500InternalServerError ,
11+ string . IsNullOrEmpty ( message ) ? "See errors or logs for more details" : message ,
12+ errors )
13+ {
14+ }
15+ public InternalServerErrorDetails ( ExceptionContext context , string title = null , string message = null , List < ErrorDetail > errors = null ) :
16+ base (
17+ context ?? throw new ArgumentNullException ( nameof ( context ) ) ,
18+ string . IsNullOrEmpty ( title ) ? "Internal Server Error" : title ,
19+ context . HttpContext . Request . Path ,
20+ StatusCodes . Status500InternalServerError ,
21+ string . IsNullOrEmpty ( message ) ? "See errors or logs for more details" : message ,
22+ errors )
1223 {
13- public InternalServerErrorDetails ( ActionContext context , string title = null , string message = null , List < ErrorDetail > errors = null )
14- {
15- if ( context is null ) throw new ArgumentNullException ( nameof ( context ) ) ;
16- Title = string . IsNullOrEmpty ( title ) == false ? title : "Internal Server Error" ;
17- Instance = context . HttpContext . Request . Path ;
18- Status = StatusCodes . Status500InternalServerError ;
19- Detail = string . IsNullOrEmpty ( message ) == false ? message : "See errors or logs for more details" ;
20- this . AddDefaultExtensionsFromContext ( context , errors ) ;
21- }
22-
23- public InternalServerErrorDetails ( ExceptionContext context , string title = null , string message = null , List < ErrorDetail > errors = null )
24- {
25- if ( context is null ) throw new ArgumentNullException ( nameof ( context ) ) ;
26- Title = string . IsNullOrEmpty ( title ) == false ? title : "Internal Server Error" ;
27- Instance = context . HttpContext . Request . Path ;
28- Status = StatusCodes . Status500InternalServerError ;
29- Detail = string . IsNullOrEmpty ( message ) == false ? message : "See errors or logs for more details" ;
30- this . AddDefaultExtensionsFromContext ( context , errors ) ;
31- }
3224 }
33- }
25+ }
0 commit comments