It would be helpful if RepositoryError exposed the underlying HTTP status code when available.
Applications may need to handle different failure cases differently, e.g. 404 Not found, 401/403 permission denied, and 500 or other server errors.
Currently callers can inspect the error message/reason, but it's not straightforward to extract the actual status code from there.
I propose adding an optional property such as statusCode?: number to RepositoryError and ensuring repository errors created from HTTP responses populate it.
Related issues
It would be helpful if
RepositoryErrorexposed the underlying HTTP status code when available.Applications may need to handle different failure cases differently, e.g. 404 Not found, 401/403 permission denied, and 500 or other server errors.
Currently callers can inspect the error message/reason, but it's not straightforward to extract the actual status code from there.
I propose adding an optional property such as
statusCode?: numbertoRepositoryErrorand ensuring repository errors created from HTTP responses populate it.Related issues