File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -191,21 +191,29 @@ def display_error_message(ex)
191
191
end
192
192
193
193
def display_exception_details ( ex )
194
+ display_exception_message_details ( ex )
195
+ display_exception_backtrace ( ex )
196
+ display_exception_details ( ex . cause ) if has_cause? ( ex )
197
+ end
198
+
199
+ def has_cause? ( ex )
200
+ ex . respond_to? ( :cause ) && ex . cause
201
+ end
202
+
203
+ def display_exception_message_details ( ex )
194
204
if ex . instance_of? ( RuntimeError )
195
205
trace ex . message
196
206
else
197
207
trace "#{ ex . class . name } : #{ ex . message } "
198
208
end
209
+ end
199
210
211
+ def display_exception_backtrace ( ex )
200
212
if options . backtrace
201
213
trace ex . backtrace . join ( "\n " )
202
214
else
203
215
trace Backtrace . collapse ( ex . backtrace ) . join ( "\n " )
204
216
end
205
-
206
- if ex . respond_to? ( :cause ) && ex . cause
207
- display_exception_details ( ex . cause )
208
- end
209
217
end
210
218
211
219
# Warn about deprecated usage.
You can’t perform that action at this time.
0 commit comments