mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Added better error handeling in axios client
This commit is contained in:
parent
133bd31473
commit
1e410e75ea
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openapi-typescript-codegen",
|
||||
"version": "0.12.2",
|
||||
"version": "0.12.3",
|
||||
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
|
||||
"author": "Ferdi Koomen",
|
||||
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",
|
||||
|
||||
@ -19,5 +19,12 @@ async function sendRequest(
|
||||
|
||||
onCancel(() => source.cancel('The user aborted a request.'));
|
||||
|
||||
return await axios.request(config);
|
||||
try {
|
||||
return await axios.request(config);
|
||||
} catch (error) {
|
||||
if (error.response) {
|
||||
return error.response;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user