Ask HN: Should I log errors, throw errors or both?
This post is close to 20 years old but it&#x27;s still how I handle errors: <a href="https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2003&#x2F;10&#x2F;13&#x2F;13&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2003&#x2F;10&#x2F;13&#x2F;13&#x2F;</a><p>From the article:<p><pre><code>    People have asked why I don’t like programming with 
    exceptions. In both Java and C++, my policy is:

    1. Never throw an exception of my own
    2. Always catch any possible exception that might be thrown by a library I’m using on the same line as it is thrown and deal with it immediately.
</code></pre>
I&#x27;ve been coding this way for ~10 years now and it&#x27;s made things a lot easier for me. If the user should know about the error, let them know about it, if it should be hidden from the user, I&#x27;ll track it in something like Sentry or Datadog and send out an alert for whoever&#x27;s on call.