mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 11:40:06 +00:00
fix(error-handling): added catch block to poll job state
This commit is contained in:
@@ -977,7 +977,13 @@ export class SASViyaApiClient {
|
||||
postJobRequestBody,
|
||||
accessToken
|
||||
)
|
||||
const jobStatus = await this.pollJobState(postedJob, etag, accessToken)
|
||||
const jobStatus = await this.pollJobState(
|
||||
postedJob,
|
||||
etag,
|
||||
accessToken
|
||||
).catch((err) => {
|
||||
throw prefixMessage(err, 'Error while polling job status. ')
|
||||
})
|
||||
const { result: currentJob } = await this.requestClient.get<Job>(
|
||||
`${this.serverUrl}/jobExecution/jobs/${postedJob.id}`,
|
||||
accessToken
|
||||
|
||||
@@ -97,7 +97,9 @@ export class RequestClient implements HttpClient {
|
||||
})
|
||||
.catch(async (e) => {
|
||||
return await this.handleError(e, () =>
|
||||
this.get<T>(url, accessToken, contentType, overrideHeaders)
|
||||
this.get<T>(url, accessToken, contentType, overrideHeaders).catch((err) => {
|
||||
throw prefixMessage(err, 'Error while executing handle error callback. ')
|
||||
})
|
||||
).catch((err) => {
|
||||
throw prefixMessage(err, 'Error while handling error. ')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user