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

Error handling #83

Open
ppwfx opened this issue Aug 30, 2016 · 1 comment
Open

Error handling #83

ppwfx opened this issue Aug 30, 2016 · 1 comment

Comments

@ppwfx
Copy link

ppwfx commented Aug 30, 2016

Hey,

seems to be a cool stack.
Is there any way to handle errors other than using error-cat?
Is bunyan also logging errors?

Have a nice day :)

@podviaznikov
Copy link
Member

podviaznikov commented Sep 7, 2016

Hi @21stio, yeah, you are correct.

Error-cat is required dependency for handling errors and bunyan is used for logging.
However the dependency on error-cat is pretty small. Ponos only requires you to throw an error of correct type:

const WorkerStopError = require('error-cat/errors/worker-stop-error')
and it also used to report error. You can easily pass some other reporting module that satisfies interface (
report(error: Error): void;
)

Bunyan is only default implementation for logging. Theoretically you can pass your own logger that can be different from bunyan logger, but it should have the same API (functions to log errors).

If you have ideas how to make error-cat and bunyan even more optional.

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

2 participants