Only send panic text if PrintStack true#245
Conversation
jszwedko
left a comment
There was a problem hiding this comment.
Thanks @trevrosen !
I do think this is closer to the original intention (6939988) of only optionally showing runtime information for debugging purposes and it makes sense to me to default to not showing anything.
Ideally, I think we'd call it something other than PrintStack in the future if we ever break compatibility.
I think we may still want have a very basic output in the case that they are not printing the stack though. Something like what you get from https://httpstat.us/500 (with a content type of text/plain and body of "Internal Server Error"). What do you think?
|
Honestly I'm OK with the status code and empty body, but I don't have a real problem w/ dumping that string to the wire. Is that blocking merge here? |
|
👍 if you aren't opposed to it. I just view it as a sensible default compared with what other webservers do and would prefer not to switch the default recovery output more times than we can avoid (i.e. if we deferred this to later). |
|
Done. I carried forward the header check/set bit even though it's not strictly necessary just in the interest of following the old code path as much as possible modulo this text change. |
jszwedko
left a comment
There was a problem hiding this comment.
Looks good, thank @trevrosen !
Only send panic text if PrintStack true
Fixes #244
What
Only print
panictext ifPrintStackis true.Why
The previous implementation would make sure that the stack wasn't sent unless
PrintStackwas set totrue, but would nonetheless send whatever text was passed topanic(). This is bad for two reasons:PrintStacktofalsewould suppress all stack trace information including the panic text.