Skip to content

Commit aaf3576

Browse files
committed
feat: adding error obj to return for api call
1 parent c6addc1 commit aaf3576

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export const createRequestFunction =
103103
<T>(axiosArgs: RequestArgs, configuration: Configuration) =>
104104
async () => {
105105
const axiosRequestArgs = { ...axiosArgs.options, url: configuration.baseUrl + axiosArgs.url };
106-
const response = await configuration.axiosInstance.request<T, AxiosResponse<T>>(axiosRequestArgs);
107-
return response.data;
106+
return configuration.axiosInstance
107+
.request<T, AxiosResponse<T>>(axiosRequestArgs)
108+
.then((response) => response.data)
109+
.catch((error) => error);
108110
};

0 commit comments

Comments
 (0)