From 8eb73a6b3ce8a44ef08fa1b5d023e62cb8f7a3df Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 25 Feb 2021 12:55:34 +0300 Subject: [PATCH 1/2] fix(RequestClient): add catch block to authorize method --- src/request/RequestClient.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/request/RequestClient.ts b/src/request/RequestClient.ts index a92fd5e..98a7fd7 100644 --- a/src/request/RequestClient.ts +++ b/src/request/RequestClient.ts @@ -346,7 +346,9 @@ export class RequestClient implements HttpClient { }) if (isAuthorizeFormRequired(res?.data as string)) { - await this.authorize(res.data as string) + await this.authorize(res.data as string).catch((err) => { + throw prefixMessage(err, 'Error while authorizing request. ') + }) } return await callback().catch((err: any) => { From 655af03cf350e2e51baeac0c9abb0afcb20e524c Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 25 Feb 2021 15:20:35 +0300 Subject: [PATCH 2/2] chore(error-handling): removed redundant catch block --- src/SASViyaApiClient.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index a67d632..9dd85cf 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -884,9 +884,7 @@ export class SASViyaApiClient { waitForResult, pollOptions, printPid - ).catch((err) => { - throw prefixMessage(err, 'Error while executing script. ') - }) + ) } /**