You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
it seems that when we attempt to fetch an invoice by using an invalid id, the client throws a generic exception.
This causes the following problem:
If we try to fetch an invoice from your api, it's not clear what the error code is. Is it a 404 because the id is invalid? Or maybe a 503 because your service is temporarily down? Or something other like an authentication issue?
All these open question marks are impossible to be handled properly with this implementation. On the other hand, our code needs to take care of each case: retry later if your api is down, or do not bother if the invoice is not found, or send an email to admins if there is an authentication issue.
My suggestion is respond using different specific exception classes for each case, or maybe simply pass the http error code to the exception. In any case, the exception returned should not be the generic \Exception to make sure we catch other exceptions thrown somewhere else.
Thank you for your time.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
it seems that when we attempt to fetch an invoice by using an invalid id, the client throws a generic exception.
This causes the following problem:
If we try to fetch an invoice from your api, it's not clear what the error code is. Is it a 404 because the id is invalid? Or maybe a 503 because your service is temporarily down? Or something other like an authentication issue?
All these open question marks are impossible to be handled properly with this implementation. On the other hand, our code needs to take care of each case: retry later if your api is down, or do not bother if the invoice is not found, or send an email to admins if there is an authentication issue.
My suggestion is respond using different specific exception classes for each case, or maybe simply pass the http error code to the exception. In any case, the exception returned should not be the generic \Exception to make sure we catch other exceptions thrown somewhere else.
Thank you for your time.
The text was updated successfully, but these errors were encountered: