question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emitting 'error'-event

See original GitHub issue

There is this line 228 in the main file in onErrored:

self.emit('error', err);

As the error is emitted, this causes the whole process to end, if the error isn’t listened on elsewhere. This can lead to server crashes if Papertrail cannot be connected to. I thought maybe this should be mentioned in the docs. 😃

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
freezycommented, Jul 13, 2016

So I’ve come across this as well.

This is the worst to debug. Without longjohn Node just crashes with a connection error, without any hint at all where the problem could be (stacktrace is a threeliner). This took me hours to find.

@matteocontrini: Are you seriously suggesting to keep your “Usage” example? This will crash the whole Node process in case something goes wrong.

For the record, there is nothing wrong with emitting your errors on your own stream. Or publish a library with a streaming API. But this is no streaming API. It’s a drop-in replacement for a logging transport. This needs at least documentation. Also examples that don’t crash the process would probably be a good idea.

0reactions
troycommented, Nov 10, 2016

@dmiddlecamp’s #61 has been released to NPM in 1.0.4. If anyone experiences this or believes they have, please make sure you’re running >= 1.0.4; it may mitigate this issue to the point of eliminating it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ErrorEvent - Web APIs - MDN Web Docs - Mozilla
desktop desktop Chrome Edge ErrorEvent Full support. Chrome10. Toggle history Full support. Edge12. Togg... ErrorEvent() constructor Full support. Chrome16. Toggle history Full support. Edge14. Togg...
Read more >
Catch all `error` events from any EventEmitter in node
When an EventEmitter instance experiences an error, the typical action is to emit an 'error' event. Error events are treated as a special ......
Read more >
ErrorEvent is emitted in websocket's 'error' event, but ... - GitHub
When binding to a WebSocket error event, it looks like you're handed an ErrorEvent , instead of an Error as currently documented.
Read more >
uvw::ErrorEvent Struct Reference
Detailed Description. The ErrorEvent event. Custom wrapper around error constants of libuv . Definition at line 22 of file emitter.h.
Read more >
Events | Node.js v19.3.0 Documentation
listenerCount(eventName); emitter.listeners(eventName); emitter.off(eventName, listener) ... the typical action is for an 'error' event to be emitted.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found