DEV Community

Sadick
Sadick

Posted on

4 1

Don’t Ignore That Error

  • Do not ignore possible errors in your code. Don’t put off handling errors until “later” (you won’t get around to it).

  • Use exceptions well, with discipline. Understand your language’s idioms and requirements for effective exception use.

  • Programmers must be made aware of programmatic errors. Users must be made aware of usage errors.

  • It’s not good enough to log the error (somewhere), and hope that a diligent operator will notice an error and do something about it one day.

  • At every step, consider all of the unusual things that might occur, no matter how unlikely you think they’ll be.

  • Always consider errors that you can recover from, and write appropriate recovery code.

  • Ensure that your error handling is idiomatic, and uses the appropriate language mechanisms.

  • Consider all potential code paths as you write your code. Do not plan to handle “unusual” cases later: you’ll forget and your code will be buggy.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay