@@ -133,33 +133,38 @@ class Store implements IStore {
133133 reject ( new Error ( 'Webex SDK failed to initialize' ) ) ;
134134 } , 6000 ) ;
135135
136- //@ts -expect-error To be fixed in SDK - https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6762
137- const webex = Webex . init ( {
138- config : options . webexConfig ,
139- credentials : {
140- access_token : options . access_token ,
141- } ,
142- } ) ;
136+ try {
137+ //@ts -expect-error To be fixed in SDK - https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6762
138+ const webex = Webex . init ( {
139+ config : options . webexConfig ,
140+ credentials : {
141+ access_token : options . access_token ,
142+ } ,
143+ } ) ;
143144
144- webex . once ( 'ready' , ( ) => {
145- setupEventListeners ( webex . cc ) ;
146- clearTimeout ( timer ) ;
147- this . registerCC ( webex )
148- . then ( ( ) => {
149- this . logger . log ( 'CC-Widgets: Store init(): store initialization complete' , {
150- module : 'cc-store#store.ts' ,
151- method : 'init' ,
145+ webex . once ( 'ready' , ( ) => {
146+ setupEventListeners ( webex . cc ) ;
147+ clearTimeout ( timer ) ;
148+ this . registerCC ( webex )
149+ . then ( ( ) => {
150+ this . logger . log ( 'CC-Widgets: Store init(): store initialization complete' , {
151+ module : 'cc-store#store.ts' ,
152+ method : 'init' ,
153+ } ) ;
154+ resolve ( ) ;
155+ } )
156+ . catch ( ( error ) => {
157+ this . logger . error ( `CC-Widgets: Store init(): registration failed - ${ error } ` , {
158+ module : 'cc-store#store.ts' ,
159+ method : 'init' ,
160+ } ) ;
161+ reject ( error ) ;
152162 } ) ;
153- resolve ( ) ;
154- } )
155- . catch ( ( error ) => {
156- this . logger . error ( `CC-Widgets: Store init(): registration failed - ${ error } ` , {
157- module : 'cc-store#store.ts' ,
158- method : 'init' ,
159- } ) ;
160- reject ( error ) ;
161- } ) ;
162- } ) ;
163+ } ) ;
164+ } catch ( error ) {
165+ clearTimeout ( timer ) ;
166+ reject ( error ) ;
167+ }
163168 } ) ;
164169 }
165170}
0 commit comments