diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 1b5e497..b52f7a5 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1110,7 +1110,10 @@ export class SASViyaApiClient { 'text/plain' ) .catch((err) => { - throw prefixMessage(err, 'Error while getting job state. ') + throw prefixMessage( + err, + 'Error while getting job state after interval. ' + ) }) postedJobState = jobState.trim() diff --git a/src/request/RequestClient.ts b/src/request/RequestClient.ts index fd1cd28..16a0e97 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) => { @@ -387,6 +388,8 @@ export class RequestClient implements HttpClient { throw new NotFoundError(response.config.url!) } + console.log(`[e]`, e) + throw e } @@ -456,6 +459,7 @@ const throwIfError = (response: AxiosResponse) => { } const error = parseError(response.data as string) + if (error) { throw error }