File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed
Nest/CommonAbstractions/Response Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ protected override bool TryGetServerErrorReason(out string reason)
2121 {
2222 reason = null ;
2323 if ( ! this . TryGetServerError ( out var serverError ) ) return false ;
24- reason = serverError ? . Error ? . Reason ;
24+ reason = serverError ? . Error ? . ToString ( ) ;
2525 return ! reason . IsNullOrEmpty ( ) ;
2626 }
2727 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ protected override bool TryGetServerErrorReason(out string reason)
2121 {
2222 reason = null ;
2323 if ( ! this . TryGetServerError ( out var serverError ) ) return false ;
24- reason = serverError ? . Error ? . Reason ;
24+ reason = serverError ? . Error ? . ToString ( ) ;
2525 return ! reason . IsNullOrEmpty ( ) ;
2626 }
2727 }
Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ public ElasticsearchClientException CreateClientException<TResponse>(TResponse r
491491
492492 var exceptionMessage = innerException ? . Message ?? $ "Request failed to execute";
493493 if ( response . TryGetServerErrorReason ( out var reason ) )
494- exceptionMessage += $ ". Error : { reason } ";
494+ exceptionMessage += $ ". ServerError : { reason } ";
495495
496496 var pipelineFailure = data . OnFailurePipelineFailure ;
497497 if ( pipelineExceptions . HasAny ( ) )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public abstract class ResponseBase : IResponse
5757
5858 bool IElasticsearchResponse . TryGetServerErrorReason ( out string reason )
5959 {
60- reason = this . ServerError ? . Error ? . Reason ;
60+ reason = this . ServerError ? . Error ? . ToString ( ) ;
6161 return ! reason . IsNullOrEmpty ( ) ;
6262 }
6363
Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ public void CanReadSingleOrMultipleCommonGramsCommonWordsItem()
3434 ) ;
3535 response . OriginalException . Should ( ) . NotBeNull ( ) . And . BeOfType < ElasticsearchClientException > ( ) ;
3636 response . OriginalException . Message . Should ( )
37- . Be ( "Request failed to execute. Error: Custom Analyzer [custom] failed to find filter under name [ascii_folding]" ) ;
37+ . StartWith ( "Request failed to execute. ServerError: " )
38+ . And . EndWith (
39+ "Type: illegal_argument_exception Reason: \" Custom Analyzer [custom] failed to find filter under name [ascii_folding]\" "
40+ ) ;
3841
3942 client . DeleteIndex ( index ) ;
4043 }
You can’t perform that action at this time.
0 commit comments