sharp
sharp copied to clipboard
Error codes on errors?
First of all, thanks for a super well made project - I love it.
I'm trying to handle any errors that sharp encounter in a graceful way, but I can't find any way to differentiate errors other than checking for substrings in the error messages, which seem brittle.
Would it be possible to add a code
property to the errors, in the same way that node does? (EACCES
, ENOENT
et all)
Hei Espen, this will definitely be a useful feature, thank you for the suggestion.
Many errors originate from libvips itself and won't have a code so a substring-based approach may still be required, at least internally.
I guess the first step is to list all the possible error conditions.