Ask HN: Should I Log Errors, Throw Errors or Both?


W3Schools
Ask HN: Should I Log Errors, Throw Errors or Both?
by Franck21 on Hacker News.
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!


W3Schools

Leave a comment