File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/Tests/ClientConcepts/Exceptions Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ public void ClientTestWhenThrowExceptionsEnabled()
45
45
var client = new ElasticClient ( settings ) ;
46
46
var exception = Assert . Throws < ElasticsearchClientException > ( ( ) => client . RootNodeInfo ( ) ) ;
47
47
var inner = exception . InnerException ;
48
+ #if DOTNETCORE
49
+ // HttpClient does not throw on "known error" status codes (i.e. 404) thus OriginalException should not be set
50
+ inner . Should ( ) . BeNull ( ) ;
51
+ #else
48
52
inner . Should ( ) . NotBeNull ( ) ;
53
+ #endif
49
54
}
50
55
51
56
[ I ]
@@ -70,7 +75,12 @@ public void ClientTestWhenThrowExceptionsDisabled()
70
75
var settings = new ConnectionSettings ( new Uri ( "http://doesntexist:9200" ) ) ;
71
76
var client = new ElasticClient ( settings ) ;
72
77
var response = client . RootNodeInfo ( ) ;
78
+ #if DOTNETCORE
79
+ // HttpClient does not throw on "known error" status codes (i.e. 404) thus OriginalException should not be set
80
+ response . CallDetails . OriginalException . Should ( ) . BeNull ( ) ;
81
+ #else
73
82
response . CallDetails . OriginalException . Should ( ) . NotBeNull ( ) ;
83
+ #endif
74
84
response . CallDetails . ServerError . Should ( ) . BeNull ( ) ;
75
85
}
76
86
}
You can’t perform that action at this time.
0 commit comments