Handling Exceptions
When a request fails, the resulting error could be of a few different shapes. To make it easier to handle, there is a method getStandardError(e: Error)
.
This method does two things:
It parses the error details (
errorDetails
) to a{message: string, errorCode?: string}[]
.It classifies the error (
e
) as one of three types:any|axios|composite
, making it possible to type discriminate the raw exception details if needed.
Last updated
Was this helpful?