1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 13:00:05 +00:00

fix(error): throw Certificate error wherever possible

This commit is contained in:
Saad Jutt
2022-04-07 23:57:44 +05:00
parent 8ea621ac98
commit a87be39b44
5 changed files with 36 additions and 10 deletions

View File

@@ -7,7 +7,8 @@ import {
LoginRequiredError,
NotFoundError,
InternalServerError,
JobExecutionError
JobExecutionError,
CertificateError
} from '../types/errors'
import { SASjsRequest } from '../types'
import { parseWeboutResponse } from '../utils/parseWeboutResponse'
@@ -517,6 +518,10 @@ export class RequestClient implements HttpClient {
else return
}
if (e.isAxiosError && e.code === 'UNABLE_TO_VERIFY_LEAF_SIGNATURE') {
throw new CertificateError(e.message)
}
if (e.message) throw e
else throw prefixMessage(e, 'Error while handling error. ')
}