@@ -8,7 +8,6 @@ import {createMachine, interpret} from 'xstate';
88import { v4 as uuid } from 'uuid' ;
99import { EffectEvent , TrackEffect } from '@webex/web-media-effects' ;
1010import { RtcMetrics } from '@webex/internal-plugin-metrics' ;
11- import ExtendedError from '../../Errors/catalog/ExtendedError' ;
1211import { ERROR_LAYER , ERROR_TYPE , ErrorContext } from '../../Errors/types' ;
1312import {
1413 handleCallErrors ,
@@ -986,8 +985,7 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
986985 method : this . handleOutgoingCallSetup . name ,
987986 } ) ;
988987 } catch ( e ) {
989- const extendedError = new Error ( `Failed to setup the call: ${ e } ` ) as ExtendedError ;
990- log . error ( extendedError , {
988+ log . error ( `Failed to setup the call: ${ JSON . stringify ( e ) } ` , {
991989 file : CALL_FILE ,
992990 method : METHODS . HANDLE_OUTGOING_CALL_SETUP ,
993991 } ) ;
@@ -1062,8 +1060,7 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
10621060 } , SUPPLEMENTARY_SERVICES_TIMEOUT ) ;
10631061 }
10641062 } catch ( e ) {
1065- const extendedError = new Error ( `Failed to put the call on hold: ${ e } ` ) as ExtendedError ;
1066- log . error ( extendedError , {
1063+ log . error ( `Failed to put the call on hold: ${ JSON . stringify ( e ) } ` , {
10671064 file : CALL_FILE ,
10681065 method : METHODS . HANDLE_CALL_HOLD ,
10691066 } ) ;
@@ -1138,8 +1135,7 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
11381135 } , SUPPLEMENTARY_SERVICES_TIMEOUT ) ;
11391136 }
11401137 } catch ( e ) {
1141- const extendedError = new Error ( `Failed to resume the call: ${ e } ` ) as ExtendedError ;
1142- log . error ( extendedError , {
1138+ log . error ( `Failed to resume the call: ${ JSON . stringify ( e ) } ` , {
11431139 file : CALL_FILE ,
11441140 method : METHODS . HANDLE_CALL_RESUME ,
11451141 } ) ;
@@ -1262,13 +1258,12 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
12621258 file : CALL_FILE ,
12631259 method : METHODS . HANDLE_OUTGOING_CALL_ALERTING ,
12641260 } ) ;
1265- } catch ( err ) {
1266- const extendedError = new Error ( `Failed to signal call progression: ${ err } ` ) as ExtendedError ;
1267- log . error ( extendedError , {
1261+ } catch ( e ) {
1262+ log . error ( `Failed to signal call progression: ${ JSON . stringify ( e ) } ` , {
12681263 file : CALL_FILE ,
12691264 method : METHODS . HANDLE_OUTGOING_CALL_ALERTING ,
12701265 } ) ;
1271- const errData = err as MobiusCallResponse ;
1266+ const errData = e as MobiusCallResponse ;
12721267
12731268 handleCallErrors (
12741269 ( error : CallError ) => {
@@ -1348,13 +1343,12 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
13481343 file : CALL_FILE ,
13491344 method : METHODS . HANDLE_OUTGOING_CALL_CONNECT ,
13501345 } ) ;
1351- } catch ( err ) {
1352- const extendedError = new Error ( `Failed to connect the call: ${ err } ` ) as ExtendedError ;
1353- log . error ( extendedError , {
1346+ } catch ( e ) {
1347+ log . error ( `Failed to connect the call: ${ JSON . stringify ( e ) } ` , {
13541348 file : CALL_FILE ,
13551349 method : METHODS . HANDLE_OUTGOING_CALL_CONNECT ,
13561350 } ) ;
1357- const errData = err as MobiusCallResponse ;
1351+ const errData = e as MobiusCallResponse ;
13581352
13591353 handleCallErrors (
13601354 ( error : CallError ) => {
@@ -1401,7 +1395,7 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
14011395 method : METHODS . HANDLE_OUTGOING_CALL_DISCONNECT ,
14021396 } ) ;
14031397 } catch ( e ) {
1404- log . warn ( ' Failed to delete the call' , {
1398+ log . warn ( ` Failed to delete the call: ${ JSON . stringify ( e ) } ` , {
14051399 file : CALL_FILE ,
14061400 method : METHODS . HANDLE_OUTGOING_CALL_DISCONNECT ,
14071401 } ) ;
@@ -2066,12 +2060,12 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
20662060 log . info ( `callFrom: ${ callFrom } ` , loggerContext ) ;
20672061 } catch ( error ) {
20682062 const errorInfo = error as WebexRequestPayload ;
2069- const errorStatus = serviceErrorCodeHandler ( errorInfo , loggerContext ) ;
2070- const errorLog = new Error (
2071- `Failed to upload webrtc telemetry statistics. ${ errorStatus } `
2072- ) as ExtendedError ;
2063+ const errorStatus = await serviceErrorCodeHandler ( errorInfo , loggerContext ) ;
20732064
2074- log . error ( errorLog , loggerContext ) ;
2065+ log . error (
2066+ `Failed to upload webrtc telemetry statistics. ${ JSON . stringify ( errorStatus ) } ` ,
2067+ loggerContext
2068+ ) ;
20752069
20762070 await uploadLogs ( {
20772071 correlationId : this . correlationId ,
0 commit comments