brave-memory-91176
06/28/2024, 8:54 AMaxios internally. However, consumers don’t necessarily need to install that dependency.
When dealing with error handling we need to type the error as AxiosError . The @ory/client package doesn’t export that type declaration, requiring consumers to install axios just for accessing the type.
If would be great if the type AxiosError can be exported from the @ory/client package so that consumers don’t need to explicitly install axios dependency.
Would that be possible? Happy to contribute to that if needed.
Thanks 🤗dazzling-napkin-4938
07/01/2024, 11:54 PMbrave-memory-91176
07/02/2024, 7:44 AMReturnType is used for functions. Here we’re talking about the error object.
try {
// some Ory API call
} catch (error) {
if (error instanceof AxiosError) {
// handle error
}
}brave-memory-91176
07/02/2024, 7:45 AMaxios is meant to be an implementation detail, we can also expose the error type with a different name like OryError or something.dazzling-napkin-4938
07/02/2024, 7:47 AMbrave-memory-91176
07/02/2024, 8:11 AM