File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/core/src/codewhisperer/util Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -368,11 +368,15 @@ export class ZipUtil {
368368 language : this . _language ,
369369 }
370370 } catch ( error ) {
371- getLogger ( ) . error ( 'Zip error caused by: %O' , error )
372- throw error
371+ this . handleZipError ( error )
373372 }
374373 }
375374
375+ protected handleZipError ( e : unknown ) : never {
376+ getLogger ( ) . error ( 'Zip error caused by: %s' , e )
377+ throw new ProjectZipError ( e instanceof Error ? e . message : 'Unknown error occurred during zip operation' )
378+ }
379+
376380 public async generateZipTestGen ( projectPath : string , initialExecution : boolean ) : Promise < ZipMetadata > {
377381 try {
378382 const zipDirPath = this . getZipDirPath ( )
@@ -421,10 +425,7 @@ export class ZipUtil {
421425 language : this . _language ,
422426 }
423427 } catch ( error ) {
424- getLogger ( ) . error ( 'Zip error caused by: %s' , error )
425- throw new ProjectZipError (
426- error instanceof Error ? error . message : 'Unknown error occurred during zip operation'
427- )
428+ this . handleZipError ( error )
428429 }
429430 }
430431 // TODO: Refactor this
You can’t perform that action at this time.
0 commit comments