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

fix(verbose-mode): fixed handling axios errors

This commit is contained in:
Yury Shkoda
2023-08-17 13:29:27 +03:00
parent 34135b889f
commit 8dd4ab8cec
4 changed files with 345 additions and 96 deletions

View File

@@ -34,7 +34,7 @@ import {
Sas9JobExecutor,
FileUploader
} from './job-execution'
import { AxiosResponse } from 'axios'
import { AxiosResponse, AxiosError } from 'axios'
interface ExecuteScriptParams {
linesOfCode: string[]
@@ -1170,8 +1170,8 @@ export default class SASjs {
* @param errorCallBack - function that should be triggered on every HTTP response with the status different from 2**.
*/
public enableVerboseMode(
successCallBack?: (response: AxiosResponse) => AxiosResponse,
errorCallBack?: (response: AxiosResponse) => AxiosResponse
successCallBack?: (response: AxiosResponse | AxiosError) => AxiosResponse,
errorCallBack?: (response: AxiosResponse | AxiosError) => AxiosResponse
) {
this.requestClient?.enableVerboseMode(successCallBack, errorCallBack)
}