diff --git a/src/request/RequestClient.ts b/src/request/RequestClient.ts index d11a76d..4c61eef 100644 --- a/src/request/RequestClient.ts +++ b/src/request/RequestClient.ts @@ -93,6 +93,7 @@ export class RequestClient implements HttpClient { .get(url, requestConfig) .then((response) => { throwIfError(response) + return this.parseResponse(response) }) .catch(async (e) => { @@ -106,7 +107,6 @@ export class RequestClient implements HttpClient { } ) ).catch((err) => { - console.log(`[err]`, err) throw prefixMessage(err, 'Error while handling error. ') }) }) @@ -388,6 +388,8 @@ export class RequestClient implements HttpClient { throw new NotFoundError(response.config.url!) } + console.log(`[e]`, e) + throw e } @@ -456,7 +458,10 @@ const throwIfError = (response: AxiosResponse) => { throw new AuthorizeError(response.data.message, authorizeRequestUrl) } + console.log(`[response]`, response) + const error = parseError(response.data as string) + if (error) { throw error }