1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-27 16:00:04 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Yury Shkoda
6a3ab7032f Merge pull request #284 from sasjs/error-handling
fix(error-handling): fixed console.log
2021-03-09 18:07:53 +03:00
Yury Shkoda
d818d14cb4 Merge branch 'master' into error-handling 2021-03-09 18:07:46 +03:00
Yury Shkoda
599c130395 fix(error-handling): fixed console.log 2021-03-09 18:06:27 +03:00
Yury Shkoda
9ef2759e27 Merge pull request #283 from sasjs/error-handling
fix(error-handling): catching unhandled promise rejection
2021-03-09 17:15:10 +03:00
Yury Shkoda
43355c88d4 Merge branch 'master' into error-handling 2021-03-09 17:12:45 +03:00
Yury Shkoda
15e1acaf4f fix(error-handling): catching unhandled promise rejection 2021-03-09 17:11:29 +03:00

View File

@@ -93,6 +93,7 @@ export class RequestClient implements HttpClient {
.get<T>(url, requestConfig)
.then((response) => {
throwIfError(response)
return this.parseResponse<T>(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
}
@@ -457,6 +459,7 @@ const throwIfError = (response: AxiosResponse) => {
}
const error = parseError(response.data as string)
if (error) {
throw error
}