Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Error objects instead of strings #85

Open
eliasmalik opened this issue Nov 14, 2016 · 0 comments
Open

Use Error objects instead of strings #85

eliasmalik opened this issue Nov 14, 2016 · 0 comments

Comments

@eliasmalik
Copy link

Here: https://github.com/fac-u/autocompleter/blob/master/public/request.js#L13

It's often better to use an Error object to encapsulate your error, since it will give you more structured information about what went wrong. In particular, it will give you the stack-trace.

cb(new Error('There was a problem...');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant