Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

Newoptions #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Newoptions #1

wants to merge 2 commits into from

Conversation

dankahle
Copy link

I thought this would be a nice way to handle the "stack" issue. I.e. you were already thinking about making the stack optional, but in reality, it's something they may or may not want for specific environments. If you let them pass that in, in a comma separated list, then they can shut down the stack where they want. By default it's always on, and off for production. I added an empty string option as well (always show the stack), as when I got to thinking about it, they might think that would do what you'd expect, always show the stack.

@dankahle
Copy link
Author

Sorry bout the diffs, I was copying code back and forth between the npm installed version, must have had different line endings or something.

@dankahle dankahle closed this Mar 26, 2015
@dankahle
Copy link
Author

Sorry accidently closed it. Was wondering what the "closed and comment" button did, now I know :).

@dankahle dankahle reopened this Mar 26, 2015
@jonathanong
Copy link
Member

Can't tell what the diff is. Can you undo spacing styles?

@dougwilson
Copy link

This whole thing is super smelly. Just add a option that is '{stack: true}or{stack: false}` and thus you can perform any environment-based logic you like.

@dankahle
Copy link
Author

I was trying to gracefully handle the following situation:

var showStack = true;
if(process.env.NODE_ENV == 'production' || process.env.NODE_ENV ==
'staging')
showStack = false;

app.use(apiErrorHandler({stack: showStack}))

with something like this instead:

app.use(apiErrorHandler({noStackEnvs: 'production, staging'}))

the code was already in there for checking the env, using that to determine
whether to show stack or not, just figured it could check more than one
then.

On Thu, Mar 26, 2015 at 11:28 AM, Douglas Christopher Wilson <
[email protected]> wrote:

This whole thing is super smelly. Just add a option that is '{stack: true}
or{stack: false}` and thus you can perform any environment-based logic
you like.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@jonchurch jonchurch mentioned this pull request Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants