File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
src/app/store/entities/sandboxes/actions Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -346,13 +346,26 @@ export default {
346346
347347 const user = currentUserSelector ( getState ( ) ) ;
348348 const token = user . integrations . zeit . token ;
349- const res = await fetch ( 'https://api.zeit.co/now/deployments' , {
350- method : 'POST' ,
351- body : JSON . stringify ( apiData ) ,
352- headers : {
353- Authorization : `bearer ${ token } ` ,
354- } ,
355- } ) ;
349+
350+ let res ;
351+ try {
352+ res = await fetch ( 'https://api.zeit.co/now/deployments' , {
353+ method : 'POST' ,
354+ body : JSON . stringify ( apiData ) ,
355+ headers : {
356+ Authorization : `bearer ${ token } ` ,
357+ } ,
358+ } ) ;
359+ } catch ( e ) {
360+ dispatch (
361+ notificationActions . addNotification (
362+ 'An unknown error occured when connecting to ZEIT' ,
363+ 'error'
364+ )
365+ ) ;
366+
367+ throw e ;
368+ }
356369
357370 const data = await res . json ( ) ;
358371
You can’t perform that action at this time.
0 commit comments