-
-
Notifications
You must be signed in to change notification settings - Fork 578
make sure all caught panics have a stack with them #1176
Conversation
@@ -58,12 +58,12 @@ func (a *App) PanicHandler(next Handler) Handler { | |||
if r != nil { //catch | |||
switch t := r.(type) { | |||
case error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might have to do err = t
otherwise err is nill still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
Codecov Report
@@ Coverage Diff @@
## development #1176 +/- ##
===========================================
Coverage 51.1% 51.1%
===========================================
Files 76 76
Lines 3835 3835
===========================================
Hits 1960 1960
Misses 1757 1757
Partials 118 118
Continue to review full report at Codecov.
|
@marwan-at-work fixed! and added some tests to make sure. thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markbates thanks. This definitely takes care of the nil error. However, Buffalo still doesn't print the stack in the log. This is probably related to #1171
fyi this is what i got
ERRO[2018-07-16T12:43:20-04:00] runtime error: invalid memory address or nil pointer dereference content_type="*/*" duration="495.828µs" human_size="0 B" method=GET params="{}" path=/hem request_id="4b361f3b89-f0c6aa9aff" size="0" status="0"
No description provided.