api-error-handler icon indicating copy to clipboard operation
api-error-handler copied to clipboard

add showStack option

Open jonchurch opened this issue 5 years ago • 1 comments

This feature has been requested a few times and attempted in several PRs such as:

#1 #2 #5 #12

Most recently something like this was requested in #11

I read the feedback from other PRs and created one that I think accomplishes the requests I saw there, such as setting the option as a boolean.

While working on this I realized that the production flag internally in the module is set at the time of require, which necessitated some tricky work in the tests. I created two new sets of tests for regression testing of this feature. They clear the require cache for this module before setting the NODE_ENV value, so we can properly test the behavior of hiding/showing stack traces based on the environment.

jonchurch avatar Feb 01 '20 22:02 jonchurch

Coverage Status

Coverage remained the same at 100.0% when pulling 947935243f2d2f4591e81f7b0145e12fc2bbcac6 on jonchurch:show-stack-option into df765a50c0c1de4fdbe4ce9cef2d910df4d8ba3e on expressjs:master.

coveralls avatar Feb 01 '20 22:02 coveralls