File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/Nest/CommonOptions/Failures Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ public class BulkError
2020 [ JsonProperty ( "caused_by" ) ]
2121 public CausedBy CausedBy { get ; internal set ; }
2222
23- public override string ToString ( ) => $ "Type: { Type } Reason: \" { Reason } \" CausedBy: \" { CausedBy } \" ";
23+ public override string ToString ( )
24+ {
25+ var cause = ( CausedBy != null ) ?
26+ $ " CausedBy:\n { CausedBy } " :
27+ string . Empty ;
28+
29+ return $ "Type: { Type } Reason: \" { Reason } \" { cause } ";
30+ }
2431 }
2532}
Original file line number Diff line number Diff line change @@ -46,5 +46,14 @@ public class CausedBy : IFailureReason
4646
4747 [ JsonProperty ( "caused_by" ) ]
4848 public CausedBy InnerCausedBy { get ; internal set ; }
49+
50+ public override string ToString ( )
51+ {
52+ var innerCause = ( InnerCausedBy != null ) ?
53+ $ " CausedBy:\n { InnerCausedBy } " :
54+ string . Empty ;
55+
56+ return $ "Type: { Type } Reason: \" { Reason } \" { innerCause } ";
57+ }
4958 }
5059}
You can’t perform that action at this time.
0 commit comments