Discussion

Ask HN: Should I log errors, throw errors or both?

Hi HN,

When programming an API, or any kind of application, software, ecc , at some point in the code you know that something could go wrong and you should notify it as an error, now, should I throw it? Or should I just log it as an error and let the program continue execution anyway? Or should I do both?

Let me know what you think are the best practices to notify errors and how you usually manage this situation.

Btw this is my first HN post:)

Thanks!

70 points Franck21 4 years ago 89 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton