Alpha
Type guard which, given an Error, checks whether it has a response field conform to the ErrorResponse type.
response
the error being checked.
whether the error has HTTP error details attached.
try { // ...} catch (e) { if (hasErrorResponse(e)) { // e.response can safely be accessed. }} Copy
try { // ...} catch (e) { if (hasErrorResponse(e)) { // e.response can safely be accessed. }}
0.0.1
Type guard which, given an Error, checks whether it has a
response
field conform to the ErrorResponse type.