-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: emit error instead of logging #4
Conversation
assuming this follows semantic versioning, I'm updating the package version to |
I'd prefer that you check for the error event actually being listened to. And if it's not error to console. The package is made for simple users so just completely disregarding all errors if they forget to add the listener seems a bit counter intuitive. |
What do you think about adding a config option? That would make more sense tbh. something like |
I'd rather you do if ('error' in this._events) {
the.emit('error', ....
} else console.error.... |
gotcha! |
I think it would be better also to include error in this export interface BasePoster {
on(event: 'posted', listener: (stats) => void);
on(event: 'error', listener: (Error) => void);
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This was merged but also accompanied with a breaking importing change in v2.0.0, you can check that here |
Right now, the developers don't have any options ( other than logs ) to know if a post call failed.
Changes
error
event is emitted instead of logging