File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,13 @@ export default async function ({ addon, console }) {
2828 try {
2929 const beginFilenameWithId = e . shiftKey !== addon . settings . get ( "beginFilenameWithId" ) ;
3030
31- const data = await ( await fetch ( `https://faretek-api.vercel.app/api/sb2gs/?id=${ projectId } ` ) ) . blob ( ) ;
32- downloadBlob ( ( beginFilenameWithId ? `${ projectId } ` : "" ) + titleStr + ".zip" , data ) ;
31+ const resp = await fetch ( `https://faretek-api.vercel.app/api/sb2gs/?id=${ projectId } ` ) ;
32+ if ( resp . status !== 200 ) {
33+ window . alert ( `Failed with code ${ resp . status } . Response content: ${ await resp . text ( ) } ` ) ;
34+ } else {
35+ const data = await resp . blob ( ) ;
36+ downloadBlob ( ( beginFilenameWithId ? `${ projectId } ` : "" ) + titleStr + ".zip" , data ) ;
37+ }
3338 } catch ( err ) {
3439 window . alert ( err ) ;
3540 }
You can’t perform that action at this time.
0 commit comments