1- using System . Net ;
1+ using System . Net ;
2+ using System . Linq ;
23
34namespace FSH . Framework . Core . Exceptions ;
45
@@ -18,9 +19,24 @@ public class CustomException : Exception
1819 /// </summary>
1920 public HttpStatusCode StatusCode { get ; }
2021
22+ public CustomException ( )
23+ : this ( "An error occurred." , Enumerable . Empty < string > ( ) , HttpStatusCode . InternalServerError )
24+ {
25+ }
26+
27+ public CustomException ( string message )
28+ : this ( message , Enumerable . Empty < string > ( ) , HttpStatusCode . InternalServerError )
29+ {
30+ }
31+
32+ public CustomException ( string message , Exception innerException )
33+ : this ( message , innerException , Enumerable . Empty < string > ( ) , HttpStatusCode . InternalServerError )
34+ {
35+ }
36+
2137 public CustomException (
2238 string message ,
23- IEnumerable < string > ? errors = null ,
39+ IEnumerable < string > ? errors ,
2440 HttpStatusCode statusCode = HttpStatusCode . InternalServerError )
2541 : base ( message )
2642 {
@@ -31,11 +47,19 @@ public CustomException(
3147 public CustomException (
3248 string message ,
3349 Exception innerException ,
34- IEnumerable < string > ? errors = null ,
50+ IEnumerable < string > ? errors ,
3551 HttpStatusCode statusCode = HttpStatusCode . InternalServerError )
3652 : base ( message , innerException )
3753 {
3854 ErrorMessages = errors ? . ToList ( ) ?? new List < string > ( ) ;
3955 StatusCode = statusCode ;
4056 }
41- }
57+
58+ public CustomException (
59+ string message ,
60+ Exception innerException ,
61+ HttpStatusCode statusCode )
62+ : this ( message , innerException , Enumerable . Empty < string > ( ) , statusCode )
63+ {
64+ }
65+ }
0 commit comments