File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @al/core" ,
3- "version" : " 1.0.189 " ,
3+ "version" : " 1.0.190 " ,
44 "description" : " Node Enterprise Packages for Alert Logic (NEPAL) Core Library" ,
55 "main" : " ./dist/index.cjs.js" ,
66 "types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ import {
5454 AlInterceptionRule ,
5555 AlInterceptionRules ,
5656} from './types' ;
57- import { AlClientBeforeRequestEvent } from './events' ;
57+ import { AlClientBeforeRequestEvent , AlClientAPIErrorEvent } from './events' ;
5858import { AIMSSessionDescriptor } from '../aims-client/types' ;
5959import { AlRuntimeConfiguration , ConfigOption } from '../configuration' ;
6060import { commonTypeSchematics } from './common.schematics' ;
@@ -975,6 +975,7 @@ export class AlApiClient implements AlValidationSchemaProvider
975975 data : errorResponse . data
976976 } ;
977977 this . log ( `APIClient Failed Request Snapshot: ${ JSON . stringify ( snapshot , null , 4 ) } ` ) ;
978+ this . events . trigger ( new AlClientAPIErrorEvent ( errorResponse . config , errorResponse ) ) ;
978979 return Promise . reject ( errorResponse ) ;
979980 }
980981
Original file line number Diff line number Diff line change 1- import { AxiosRequestConfig } from 'axios' ;
1+ import { AxiosRequestConfig , AxiosResponse } from 'axios' ;
22import {
33 AlTrigger ,
44 AlTriggeredEvent ,
@@ -12,3 +12,11 @@ export class AlClientBeforeRequestEvent extends AlTriggeredEvent<void>
1212 super ( ) ;
1313 }
1414}
15+
16+ @AlTrigger ( 'AlClientAPIError' )
17+ export class AlClientAPIErrorEvent extends AlTriggeredEvent < void >
18+ {
19+ constructor ( public request :APIRequestParams , public errorResponse :AxiosResponse ) {
20+ super ( ) ;
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments