Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Minor Updates #1

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

Minor Updates #1

wants to merge 4 commits into from

Conversation

benjaminpearson
Copy link

  • Allowed statusCode to come from the defined error if it was specified
  • Allowed logLevel to come from the defined error if it was specified
  • Fixed callback possibly being undefined when being executed. For instance in /lib/index.js the catchErr and catchNamedErr it was not silently catching errors if you didn't have a callback defined.
  • Removed dependency on environment variable in order to log pretty. This means pretty won't be being called at the moment. Ideally the function would be changed to allow an option for printing pretty and not replace the existing stack trace with a new version (because we want the normal stack trace to be available for some log outlets such as Loggly or Sentry). We've removed it and used the logic of pretty formatting separately in our application logging code base for now.

Benjamin Pearson added 4 commits November 25, 2015 15:52
Callback was only being checked to be a function in one location, not
everytime it was used. Instead callback is now checked to be a function
at the top otherwise a empty function is assigned to it so the
executions don’t cause errors.

```
/node_modules/fancy-errors/lib/index.js:64
      callback(err);
      ^
TypeError: undefined is not a function
    at Object.catchErr [as catch]
(/node_modules/fancy-errors/lib/index.js:64:7)
```
The dependency on the node env variable felt too much like a side
effect we couldn’t control. Would prefer to pass an option to print
pretty and not have it override the stack trace value, rather have a
function that returns a prettified stack trace for logging.
@camjc
Copy link

camjc commented Mar 19, 2020

@benjaminpearson Should we archive this repo? Seems pretty untouched. Having a look at migration paths now.

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.

2 participants