@@ -9,17 +9,17 @@ public class Error
9
9
{
10
10
public Error ( )
11
11
{ }
12
-
12
+
13
13
[ Obsolete ( "Use Error constructors with int typed status" ) ]
14
- public Error ( string status , string title , ErrorMeta meta = null , string source = null )
14
+ public Error ( string status , string title , ErrorMeta meta = null , object source = null )
15
15
{
16
16
Status = status ;
17
17
Title = title ;
18
18
Meta = meta ;
19
19
Source = source ;
20
20
}
21
21
22
- public Error ( int status , string title , ErrorMeta meta = null , string source = null )
22
+ public Error ( int status , string title , ErrorMeta meta = null , object source = null )
23
23
{
24
24
Status = status . ToString ( ) ;
25
25
Title = title ;
@@ -28,7 +28,7 @@ public Error(int status, string title, ErrorMeta meta = null, string source = nu
28
28
}
29
29
30
30
[ Obsolete ( "Use Error constructors with int typed status" ) ]
31
- public Error ( string status , string title , string detail , ErrorMeta meta = null , string source = null )
31
+ public Error ( string status , string title , string detail , ErrorMeta meta = null , object source = null )
32
32
{
33
33
Status = status ;
34
34
Title = title ;
@@ -37,29 +37,29 @@ public Error(string status, string title, string detail, ErrorMeta meta = null,
37
37
Source = source ;
38
38
}
39
39
40
- public Error ( int status , string title , string detail , ErrorMeta meta = null , string source = null )
40
+ public Error ( int status , string title , string detail , ErrorMeta meta = null , object source = null )
41
41
{
42
42
Status = status . ToString ( ) ;
43
43
Title = title ;
44
44
Detail = detail ;
45
45
Meta = meta ;
46
46
Source = source ;
47
47
}
48
-
48
+
49
49
[ JsonProperty ( "title" ) ]
50
50
public string Title { get ; set ; }
51
51
52
52
[ JsonProperty ( "detail" ) ]
53
53
public string Detail { get ; set ; }
54
-
54
+
55
55
[ JsonProperty ( "status" ) ]
56
56
public string Status { get ; set ; }
57
57
58
58
[ JsonIgnore ]
59
59
public int StatusCode => int . Parse ( Status ) ;
60
60
61
61
[ JsonProperty ( "source" ) ]
62
- public string Source { get ; set ; }
62
+ public object Source { get ; set ; }
63
63
64
64
[ JsonProperty ( "meta" ) ]
65
65
public ErrorMeta Meta { get ; set ; }
@@ -73,8 +73,8 @@ public class ErrorMeta
73
73
[ JsonProperty ( "stackTrace" ) ]
74
74
public string [ ] StackTrace { get ; set ; }
75
75
76
- public static ErrorMeta FromException ( Exception e )
77
- => new ErrorMeta {
76
+ public static ErrorMeta FromException ( Exception e )
77
+ => new ErrorMeta {
78
78
StackTrace = e . Demystify ( ) . ToString ( ) . Split ( new [ ] { "\n " } , int . MaxValue , StringSplitOptions . RemoveEmptyEntries )
79
79
} ;
80
80
}
0 commit comments