DEV Community

Adam Crockett πŸŒ€
Adam Crockett πŸŒ€

Posted on

Errors

How do you handle errors, there are a couple of strategies:

  • don't handle errors
  • errors with warnings
  • a general error
  • an error per issue
  • no errors just defaults and failover
  • I don't get errors πŸ€·β€β™‚οΈ

Out of each strategy which do you prefer as your overarching style of dealing with errors?

Top comments (4)

Collapse
 
guillermoprados profile image
Guille

Errors must be always handled.. if for any reason the error cannot be solved in the current layer, you must throw it to the upper one.. simple as that. At some point, it needs to be fixed. Not warnings, non general errors, nothing, if there is an error you fix it or you throw it to the upper layer (only if it makes sense)

Collapse
 
epranka profile image
Edvinas Pranka

Errors handling is the worst thing in my projects :D

Collapse
 
alohci profile image
Nicholas Stimpson

Why would you have an overarching, one-size-fits-all strategy? Choose the appropriate strategy for every error.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Because this wouldn't be a discussion if we said I use everything. 😁