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()
4545 var client = new ElasticClient ( settings ) ;
4646 var exception = Assert . Throws < ElasticsearchClientException > ( ( ) => client . RootNodeInfo ( ) ) ;
4747 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
4852 inner . Should ( ) . NotBeNull ( ) ;
53+ #endif
4954 }
5055
5156 [ I ]
@@ -70,7 +75,12 @@ public void ClientTestWhenThrowExceptionsDisabled()
7075 var settings = new ConnectionSettings ( new Uri ( "http://doesntexist:9200" ) ) ;
7176 var client = new ElasticClient ( settings ) ;
7277 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
7382 response . CallDetails . OriginalException . Should ( ) . NotBeNull ( ) ;
83+ #endif
7484 response . CallDetails . ServerError . Should ( ) . BeNull ( ) ;
7585 }
7686 }
You can’t perform that action at this time.
0 commit comments