@webex/contact-center 3.9.0-next.5 → 3.9.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc.js +14 -0
- package/dist/cc.js.map +1 -1
- package/dist/metrics/MetricsManager.js +1 -1
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/constants.js +2 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/core/GlobalTypes.js.map +1 -1
- package/dist/services/core/Utils.js +47 -2
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +0 -4
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +0 -4
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/index.js +122 -52
- package/dist/services/task/index.js.map +1 -1
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/types/services/core/GlobalTypes.d.ts +25 -0
- package/dist/types/services/core/Utils.d.ts +16 -1
- package/dist/webex.js +1 -1
- package/package.json +2 -2
- package/src/cc.ts +15 -0
- package/src/metrics/MetricsManager.ts +1 -1
- package/src/metrics/constants.ts +3 -0
- package/src/services/core/GlobalTypes.ts +27 -0
- package/src/services/core/Utils.ts +57 -1
- package/src/services/core/aqm-reqs.ts +0 -5
- package/src/services/core/websocket/WebSocketManager.ts +0 -4
- package/src/services/task/index.ts +124 -28
- package/test/unit/spec/metrics/MetricsManager.ts +0 -1
- package/test/unit/spec/services/core/aqm-reqs.ts +1 -3
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +0 -4
- package/test/unit/spec/services/task/index.ts +153 -111
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Err from './Err';
|
|
2
2
|
import {LoginOption, WebexRequestPayload} from '../../types';
|
|
3
|
-
import {Failure} from './GlobalTypes';
|
|
3
|
+
import {Failure, AugmentedError} from './GlobalTypes';
|
|
4
4
|
import LoggerProxy from '../../logger-proxy';
|
|
5
5
|
import WebexRequest from './WebexRequest';
|
|
6
6
|
import {
|
|
@@ -143,6 +143,62 @@ export const getErrorDetails = (error: any, methodName: string, moduleName: stri
|
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Extracts error details from task API errors and logs them. Also uploads logs for the error.
|
|
148
|
+
* This handles the specific error format returned by task API calls.
|
|
149
|
+
*
|
|
150
|
+
* @param error - The error object from task API calls with structure: {id: string, details: {trackingId: string, msg: {...}}}
|
|
151
|
+
* @param methodName - The name of the method where the error occurred.
|
|
152
|
+
* @param moduleName - The name of the module where the error occurred.
|
|
153
|
+
* @returns AugmentedError containing structured error details on err.data for metrics and logging
|
|
154
|
+
* @public
|
|
155
|
+
* @example
|
|
156
|
+
* const taskError = generateTaskErrorObject(error, 'transfer', 'TaskModule');
|
|
157
|
+
* throw taskError.error;
|
|
158
|
+
* @ignore
|
|
159
|
+
*/
|
|
160
|
+
export const generateTaskErrorObject = (
|
|
161
|
+
error: any,
|
|
162
|
+
methodName: string,
|
|
163
|
+
moduleName: string
|
|
164
|
+
): AugmentedError => {
|
|
165
|
+
const trackingId = error?.details?.trackingId || error?.trackingId || '';
|
|
166
|
+
const errorMsg = error?.details?.msg;
|
|
167
|
+
|
|
168
|
+
const fallbackMessage =
|
|
169
|
+
(error && typeof error.message === 'string' && error.message) ||
|
|
170
|
+
`Error while performing ${methodName}`;
|
|
171
|
+
const errorMessage = errorMsg?.errorMessage || fallbackMessage;
|
|
172
|
+
const errorType =
|
|
173
|
+
errorMsg?.errorType ||
|
|
174
|
+
(error && typeof error.name === 'string' && error.name) ||
|
|
175
|
+
'Unknown Error';
|
|
176
|
+
const errorData = errorMsg?.errorData || '';
|
|
177
|
+
const reasonCode = errorMsg?.reasonCode || 0;
|
|
178
|
+
|
|
179
|
+
// Log and upload for Task API formatted errors
|
|
180
|
+
LoggerProxy.error(`${methodName} failed: ${errorMessage} (${errorType})`, {
|
|
181
|
+
module: moduleName,
|
|
182
|
+
method: methodName,
|
|
183
|
+
trackingId,
|
|
184
|
+
});
|
|
185
|
+
WebexRequest.getInstance().uploadLogs({
|
|
186
|
+
correlationId: trackingId,
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const reason = `${errorType}: ${errorMessage}${errorData ? ` (${errorData})` : ''}`;
|
|
190
|
+
const err: AugmentedError = new Error(reason);
|
|
191
|
+
err.data = {
|
|
192
|
+
message: errorMessage,
|
|
193
|
+
errorType,
|
|
194
|
+
errorData,
|
|
195
|
+
reasonCode,
|
|
196
|
+
trackingId,
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
return err;
|
|
200
|
+
};
|
|
201
|
+
|
|
146
202
|
/**
|
|
147
203
|
* Creates an error details object suitable for use with the Err.Details class.
|
|
148
204
|
*
|
|
@@ -178,10 +178,6 @@ export class WebSocketManager extends EventEmitter {
|
|
|
178
178
|
issueReason = 'WebSocket auto close timed out. Forcefully closed websocket.';
|
|
179
179
|
} else {
|
|
180
180
|
const onlineStatus = navigator.onLine;
|
|
181
|
-
LoggerProxy.info(`[WebSocketStatus] | desktop online status is ${onlineStatus}`, {
|
|
182
|
-
module: WEB_SOCKET_MANAGER_FILE,
|
|
183
|
-
method: METHODS.WEB_SOCKET_ON_CLOSE_HANDLER,
|
|
184
|
-
});
|
|
185
181
|
issueReason = !onlineStatus
|
|
186
182
|
? 'network issue'
|
|
187
183
|
: 'missing keepalive from either desktop or notif service';
|
|
@@ -2,10 +2,11 @@ import EventEmitter from 'events';
|
|
|
2
2
|
import {CALL_EVENT_KEYS, LocalMicrophoneStream} from '@webex/calling';
|
|
3
3
|
import {CallId} from '@webex/calling/dist/types/common/types';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
generateTaskErrorObject,
|
|
6
6
|
deriveConsultTransferDestinationType,
|
|
7
7
|
getDestinationAgentId,
|
|
8
8
|
} from '../core/Utils';
|
|
9
|
+
import {Failure} from '../core/GlobalTypes';
|
|
9
10
|
import {LoginOption} from '../../types';
|
|
10
11
|
import {TASK_FILE} from '../../constants';
|
|
11
12
|
import {METHODS} from './constants';
|
|
@@ -29,7 +30,6 @@ import {
|
|
|
29
30
|
import WebCallingService from '../WebCallingService';
|
|
30
31
|
import MetricsManager from '../../metrics/MetricsManager';
|
|
31
32
|
import {METRIC_EVENT_NAMES} from '../../metrics/constants';
|
|
32
|
-
import {Failure} from '../core/GlobalTypes';
|
|
33
33
|
import AutoWrapup from './AutoWrapup';
|
|
34
34
|
import {WrapupData} from '../config/types';
|
|
35
35
|
|
|
@@ -376,17 +376,25 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
376
376
|
|
|
377
377
|
return Promise.resolve(); // TODO: reject for extension as part of refactor
|
|
378
378
|
} catch (error) {
|
|
379
|
-
const
|
|
379
|
+
const err = generateTaskErrorObject(error, METHODS.ACCEPT, TASK_FILE);
|
|
380
|
+
const taskErrorProps = {
|
|
381
|
+
trackingId: err.data?.trackingId,
|
|
382
|
+
errorMessage: err.data?.message,
|
|
383
|
+
errorType: err.data?.errorType,
|
|
384
|
+
errorData: err.data?.errorData,
|
|
385
|
+
reasonCode: err.data?.reasonCode,
|
|
386
|
+
};
|
|
380
387
|
this.metricsManager.trackEvent(
|
|
381
388
|
METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED,
|
|
382
389
|
{
|
|
383
390
|
taskId: this.data.interactionId,
|
|
384
391
|
error: error.toString(),
|
|
392
|
+
...taskErrorProps,
|
|
385
393
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details as Failure),
|
|
386
394
|
},
|
|
387
395
|
['operational', 'behavioral', 'business']
|
|
388
396
|
);
|
|
389
|
-
throw
|
|
397
|
+
throw err;
|
|
390
398
|
}
|
|
391
399
|
}
|
|
392
400
|
|
|
@@ -425,8 +433,8 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
425
433
|
|
|
426
434
|
return Promise.resolve();
|
|
427
435
|
} catch (error) {
|
|
428
|
-
const
|
|
429
|
-
throw
|
|
436
|
+
const err = generateTaskErrorObject(error, METHODS.TOGGLE_MUTE, TASK_FILE);
|
|
437
|
+
throw err;
|
|
430
438
|
}
|
|
431
439
|
}
|
|
432
440
|
|
|
@@ -473,17 +481,25 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
473
481
|
|
|
474
482
|
return Promise.resolve();
|
|
475
483
|
} catch (error) {
|
|
476
|
-
const
|
|
484
|
+
const err = generateTaskErrorObject(error, METHODS.DECLINE, TASK_FILE);
|
|
485
|
+
const taskErrorProps = {
|
|
486
|
+
trackingId: err.data?.trackingId,
|
|
487
|
+
errorMessage: err.data?.message,
|
|
488
|
+
errorType: err.data?.errorType,
|
|
489
|
+
errorData: err.data?.errorData,
|
|
490
|
+
reasonCode: err.data?.reasonCode,
|
|
491
|
+
};
|
|
477
492
|
this.metricsManager.trackEvent(
|
|
478
493
|
METRIC_EVENT_NAMES.TASK_DECLINE_FAILED,
|
|
479
494
|
{
|
|
480
495
|
taskId: this.data.interactionId,
|
|
481
496
|
error: error.toString(),
|
|
497
|
+
...taskErrorProps,
|
|
482
498
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
483
499
|
},
|
|
484
500
|
['operational', 'behavioral']
|
|
485
501
|
);
|
|
486
|
-
throw
|
|
502
|
+
throw err;
|
|
487
503
|
}
|
|
488
504
|
}
|
|
489
505
|
|
|
@@ -550,18 +566,26 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
550
566
|
|
|
551
567
|
return response;
|
|
552
568
|
} catch (error) {
|
|
553
|
-
const
|
|
569
|
+
const err = generateTaskErrorObject(error, METHODS.HOLD, TASK_FILE);
|
|
570
|
+
const taskErrorProps = {
|
|
571
|
+
trackingId: err.data?.trackingId,
|
|
572
|
+
errorMessage: err.data?.message,
|
|
573
|
+
errorType: err.data?.errorType,
|
|
574
|
+
errorData: err.data?.errorData,
|
|
575
|
+
reasonCode: err.data?.reasonCode,
|
|
576
|
+
};
|
|
554
577
|
this.metricsManager.trackEvent(
|
|
555
578
|
METRIC_EVENT_NAMES.TASK_HOLD_FAILED,
|
|
556
579
|
{
|
|
557
580
|
taskId: this.data.interactionId,
|
|
558
581
|
mediaResourceId: this.data.mediaResourceId,
|
|
559
582
|
error: error.toString(),
|
|
583
|
+
...taskErrorProps,
|
|
560
584
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
561
585
|
},
|
|
562
586
|
['operational', 'behavioral']
|
|
563
587
|
);
|
|
564
|
-
throw
|
|
588
|
+
throw err;
|
|
565
589
|
}
|
|
566
590
|
}
|
|
567
591
|
|
|
@@ -631,8 +655,15 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
631
655
|
|
|
632
656
|
return response;
|
|
633
657
|
} catch (error) {
|
|
634
|
-
const
|
|
658
|
+
const err = generateTaskErrorObject(error, METHODS.RESUME, TASK_FILE);
|
|
635
659
|
const mainInteractionId = this.data.interaction?.mainInteractionId;
|
|
660
|
+
const taskErrorProps = {
|
|
661
|
+
trackingId: err.data?.trackingId,
|
|
662
|
+
errorMessage: err.data?.message,
|
|
663
|
+
errorType: err.data?.errorType,
|
|
664
|
+
errorData: err.data?.errorData,
|
|
665
|
+
reasonCode: err.data?.reasonCode,
|
|
666
|
+
};
|
|
636
667
|
this.metricsManager.trackEvent(
|
|
637
668
|
METRIC_EVENT_NAMES.TASK_RESUME_FAILED,
|
|
638
669
|
{
|
|
@@ -641,11 +672,12 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
641
672
|
mediaResourceId: mainInteractionId
|
|
642
673
|
? this.data.interaction.media[mainInteractionId].mediaResourceId
|
|
643
674
|
: '',
|
|
675
|
+
...taskErrorProps,
|
|
644
676
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
645
677
|
},
|
|
646
678
|
['operational', 'behavioral']
|
|
647
679
|
);
|
|
648
|
-
throw
|
|
680
|
+
throw err;
|
|
649
681
|
}
|
|
650
682
|
}
|
|
651
683
|
|
|
@@ -725,16 +757,24 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
725
757
|
|
|
726
758
|
return response;
|
|
727
759
|
} catch (error) {
|
|
728
|
-
const
|
|
760
|
+
const err = generateTaskErrorObject(error, METHODS.END, TASK_FILE);
|
|
761
|
+
const taskErrorProps = {
|
|
762
|
+
trackingId: err.data?.trackingId,
|
|
763
|
+
errorMessage: err.data?.message,
|
|
764
|
+
errorType: err.data?.errorType,
|
|
765
|
+
errorData: err.data?.errorData,
|
|
766
|
+
reasonCode: err.data?.reasonCode,
|
|
767
|
+
};
|
|
729
768
|
this.metricsManager.trackEvent(
|
|
730
769
|
METRIC_EVENT_NAMES.TASK_END_FAILED,
|
|
731
770
|
{
|
|
732
771
|
taskId: this.data.interactionId,
|
|
772
|
+
...taskErrorProps,
|
|
733
773
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
734
774
|
},
|
|
735
775
|
['operational', 'behavioral', 'business']
|
|
736
776
|
);
|
|
737
|
-
throw
|
|
777
|
+
throw err;
|
|
738
778
|
}
|
|
739
779
|
}
|
|
740
780
|
|
|
@@ -829,18 +869,26 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
829
869
|
|
|
830
870
|
return response;
|
|
831
871
|
} catch (error) {
|
|
832
|
-
const
|
|
872
|
+
const err = generateTaskErrorObject(error, METHODS.WRAPUP, TASK_FILE);
|
|
873
|
+
const taskErrorProps = {
|
|
874
|
+
trackingId: err.data?.trackingId,
|
|
875
|
+
errorMessage: err.data?.message,
|
|
876
|
+
errorType: err.data?.errorType,
|
|
877
|
+
errorData: err.data?.errorData,
|
|
878
|
+
reasonCode: err.data?.reasonCode,
|
|
879
|
+
};
|
|
833
880
|
this.metricsManager.trackEvent(
|
|
834
881
|
METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED,
|
|
835
882
|
{
|
|
836
883
|
taskId: this.data.interactionId,
|
|
837
884
|
wrapUpCode: wrapupPayload.auxCodeId,
|
|
838
885
|
wrapUpReason: wrapupPayload.wrapUpReason,
|
|
886
|
+
...taskErrorProps,
|
|
839
887
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
840
888
|
},
|
|
841
889
|
['operational', 'behavioral', 'business']
|
|
842
890
|
);
|
|
843
|
-
throw
|
|
891
|
+
throw err;
|
|
844
892
|
}
|
|
845
893
|
}
|
|
846
894
|
|
|
@@ -909,17 +957,25 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
909
957
|
|
|
910
958
|
return result;
|
|
911
959
|
} catch (error) {
|
|
912
|
-
const
|
|
960
|
+
const err = generateTaskErrorObject(error, METHODS.PAUSE_RECORDING, TASK_FILE);
|
|
961
|
+
const taskErrorProps = {
|
|
962
|
+
trackingId: err.data?.trackingId,
|
|
963
|
+
errorMessage: err.data?.message,
|
|
964
|
+
errorType: err.data?.errorType,
|
|
965
|
+
errorData: err.data?.errorData,
|
|
966
|
+
reasonCode: err.data?.reasonCode,
|
|
967
|
+
};
|
|
913
968
|
this.metricsManager.trackEvent(
|
|
914
969
|
METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED,
|
|
915
970
|
{
|
|
916
971
|
taskId: this.data.interactionId,
|
|
917
972
|
error: error.toString(),
|
|
973
|
+
...taskErrorProps,
|
|
918
974
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
919
975
|
},
|
|
920
976
|
['operational', 'behavioral', 'business']
|
|
921
977
|
);
|
|
922
|
-
throw
|
|
978
|
+
throw err;
|
|
923
979
|
}
|
|
924
980
|
}
|
|
925
981
|
|
|
@@ -1000,17 +1056,25 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1000
1056
|
|
|
1001
1057
|
return result;
|
|
1002
1058
|
} catch (error) {
|
|
1003
|
-
const
|
|
1059
|
+
const err = generateTaskErrorObject(error, METHODS.RESUME_RECORDING, TASK_FILE);
|
|
1060
|
+
const taskErrorProps = {
|
|
1061
|
+
trackingId: err.data?.trackingId,
|
|
1062
|
+
errorMessage: err.data?.message,
|
|
1063
|
+
errorType: err.data?.errorType,
|
|
1064
|
+
errorData: err.data?.errorData,
|
|
1065
|
+
reasonCode: err.data?.reasonCode,
|
|
1066
|
+
};
|
|
1004
1067
|
this.metricsManager.trackEvent(
|
|
1005
1068
|
METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED,
|
|
1006
1069
|
{
|
|
1007
1070
|
taskId: this.data.interactionId,
|
|
1008
1071
|
error: error.toString(),
|
|
1072
|
+
...taskErrorProps,
|
|
1009
1073
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
1010
1074
|
},
|
|
1011
1075
|
['operational', 'behavioral', 'business']
|
|
1012
1076
|
);
|
|
1013
|
-
throw
|
|
1077
|
+
throw err;
|
|
1014
1078
|
}
|
|
1015
1079
|
}
|
|
1016
1080
|
|
|
@@ -1085,7 +1149,14 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1085
1149
|
|
|
1086
1150
|
return result;
|
|
1087
1151
|
} catch (error) {
|
|
1088
|
-
const
|
|
1152
|
+
const err = generateTaskErrorObject(error, METHODS.CONSULT, TASK_FILE);
|
|
1153
|
+
const taskErrorProps = {
|
|
1154
|
+
trackingId: err.data?.trackingId,
|
|
1155
|
+
errorMessage: err.data?.message,
|
|
1156
|
+
errorType: err.data?.errorType,
|
|
1157
|
+
errorData: err.data?.errorData,
|
|
1158
|
+
reasonCode: err.data?.reasonCode,
|
|
1159
|
+
};
|
|
1089
1160
|
this.metricsManager.trackEvent(
|
|
1090
1161
|
METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED,
|
|
1091
1162
|
{
|
|
@@ -1093,11 +1164,12 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1093
1164
|
destination: consultPayload.to,
|
|
1094
1165
|
destinationType: consultPayload.destinationType,
|
|
1095
1166
|
error: error.toString(),
|
|
1167
|
+
...taskErrorProps,
|
|
1096
1168
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
1097
1169
|
},
|
|
1098
1170
|
['operational', 'behavioral', 'business']
|
|
1099
1171
|
);
|
|
1100
|
-
throw
|
|
1172
|
+
throw err;
|
|
1101
1173
|
}
|
|
1102
1174
|
}
|
|
1103
1175
|
|
|
@@ -1170,17 +1242,25 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1170
1242
|
|
|
1171
1243
|
return result;
|
|
1172
1244
|
} catch (error) {
|
|
1173
|
-
const
|
|
1245
|
+
const err = generateTaskErrorObject(error, METHODS.END_CONSULT, TASK_FILE);
|
|
1246
|
+
const taskErrorProps = {
|
|
1247
|
+
trackingId: err.data?.trackingId,
|
|
1248
|
+
errorMessage: err.data?.message,
|
|
1249
|
+
errorType: err.data?.errorType,
|
|
1250
|
+
errorData: err.data?.errorData,
|
|
1251
|
+
reasonCode: err.data?.reasonCode,
|
|
1252
|
+
};
|
|
1174
1253
|
this.metricsManager.trackEvent(
|
|
1175
1254
|
METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED,
|
|
1176
1255
|
{
|
|
1177
1256
|
taskId: this.data.interactionId,
|
|
1178
1257
|
error: error.toString(),
|
|
1258
|
+
...taskErrorProps,
|
|
1179
1259
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
1180
1260
|
},
|
|
1181
1261
|
['operational', 'behavioral', 'business']
|
|
1182
1262
|
);
|
|
1183
|
-
throw
|
|
1263
|
+
throw err;
|
|
1184
1264
|
}
|
|
1185
1265
|
}
|
|
1186
1266
|
|
|
@@ -1261,7 +1341,14 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1261
1341
|
|
|
1262
1342
|
return result;
|
|
1263
1343
|
} catch (error) {
|
|
1264
|
-
const
|
|
1344
|
+
const err = generateTaskErrorObject(error, METHODS.TRANSFER, TASK_FILE);
|
|
1345
|
+
const taskErrorProps = {
|
|
1346
|
+
trackingId: err.data?.trackingId,
|
|
1347
|
+
errorMessage: err.data?.message,
|
|
1348
|
+
errorType: err.data?.errorType,
|
|
1349
|
+
errorData: err.data?.errorData,
|
|
1350
|
+
reasonCode: err.data?.reasonCode,
|
|
1351
|
+
};
|
|
1265
1352
|
this.metricsManager.trackEvent(
|
|
1266
1353
|
METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED,
|
|
1267
1354
|
{
|
|
@@ -1270,11 +1357,12 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1270
1357
|
destinationType: transferPayload.destinationType,
|
|
1271
1358
|
isConsultTransfer: false,
|
|
1272
1359
|
error: error.toString(),
|
|
1360
|
+
...taskErrorProps,
|
|
1273
1361
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
1274
1362
|
},
|
|
1275
1363
|
['operational', 'behavioral', 'business']
|
|
1276
1364
|
);
|
|
1277
|
-
throw
|
|
1365
|
+
throw err;
|
|
1278
1366
|
}
|
|
1279
1367
|
}
|
|
1280
1368
|
|
|
@@ -1371,7 +1459,14 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1371
1459
|
|
|
1372
1460
|
return result;
|
|
1373
1461
|
} catch (error) {
|
|
1374
|
-
const
|
|
1462
|
+
const err = generateTaskErrorObject(error, METHODS.CONSULT_TRANSFER, TASK_FILE);
|
|
1463
|
+
const taskErrorProps = {
|
|
1464
|
+
trackingId: err.data?.trackingId,
|
|
1465
|
+
errorMessage: err.data?.message,
|
|
1466
|
+
errorType: err.data?.errorType,
|
|
1467
|
+
errorData: err.data?.errorData,
|
|
1468
|
+
reasonCode: err.data?.reasonCode,
|
|
1469
|
+
};
|
|
1375
1470
|
const failedDestinationType = deriveConsultTransferDestinationType(this.data);
|
|
1376
1471
|
const failedDestAgentId = getDestinationAgentId(
|
|
1377
1472
|
this.data.interaction?.participants,
|
|
@@ -1385,11 +1480,12 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
1385
1480
|
destinationType: failedDestinationType,
|
|
1386
1481
|
isConsultTransfer: true,
|
|
1387
1482
|
error: error.toString(),
|
|
1483
|
+
...taskErrorProps,
|
|
1388
1484
|
...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),
|
|
1389
1485
|
},
|
|
1390
1486
|
['operational', 'behavioral', 'business']
|
|
1391
1487
|
);
|
|
1392
|
-
throw
|
|
1488
|
+
throw err;
|
|
1393
1489
|
}
|
|
1394
1490
|
}
|
|
1395
1491
|
}
|
|
@@ -3,7 +3,6 @@ import MetricsManager from '../../../../src/metrics/MetricsManager';
|
|
|
3
3
|
import {METRIC_EVENT_NAMES} from '../../../../src/metrics/constants';
|
|
4
4
|
import {WebexSDK} from '../../../../src/types';
|
|
5
5
|
import {EventPayload} from '@webex/internal-plugin-metrics/src/metrics.types';
|
|
6
|
-
import LoggerProxy from '../../../../src/logger-proxy';
|
|
7
6
|
|
|
8
7
|
describe('MetricsManagerImplementation', () => {
|
|
9
8
|
let webex: WebexSDK;
|
|
@@ -381,9 +381,7 @@ describe('AqmReqs', () => {
|
|
|
381
381
|
data: { type: 'KeepaliveEvent' },
|
|
382
382
|
})
|
|
383
383
|
);
|
|
384
|
-
|
|
385
|
-
expect(LoggerProxy.info).toHaveBeenCalledWith('Keepalive from web socket', {"method": "onMessage", "module": AQM_REQS_FILE});
|
|
386
|
-
|
|
384
|
+
|
|
387
385
|
// Unhandled event
|
|
388
386
|
webSocketManagerInstance.emit(
|
|
389
387
|
'message',
|
|
@@ -200,10 +200,6 @@ describe('WebSocketManager', () => {
|
|
|
200
200
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
201
201
|
|
|
202
202
|
expect(mockWorker.postMessage).toHaveBeenCalledWith({ type: 'terminate' });
|
|
203
|
-
expect(LoggerProxy.info).toHaveBeenCalledWith(
|
|
204
|
-
'[WebSocketStatus] | desktop online status is false',
|
|
205
|
-
{ module: WEB_SOCKET_MANAGER_FILE, method: 'webSocketOnCloseHandler' }
|
|
206
|
-
);
|
|
207
203
|
expect(LoggerProxy.error).toHaveBeenCalledWith(
|
|
208
204
|
'[WebSocketStatus] | event=webSocketClose | WebSocket connection closed REASON: network issue',
|
|
209
205
|
{ module: WEB_SOCKET_MANAGER_FILE, method: 'webSocketOnCloseHandler' }
|