File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -746,11 +746,6 @@ async function compileContents(
746746 return ;
747747 }
748748
749- getLogger ( ) . log ( "Resetting compilation status." ) ;
750- // Reset compilation status as this compilation finished
751- entry . compilation = null ;
752- entry . abortCompilation = null ;
753-
754749 processAndPublishDiagnostics (
755750 entry ,
756751 result ,
@@ -765,11 +760,19 @@ async function compileContents(
765760 `Compilation of ${ entry . file . sourceFileName } was aborted.` ,
766761 ) ;
767762 } else {
763+ getLogger ( ) . error (
764+ `Unexpected error during compilation of ${ entry . file . sourceFileName } : ${ error } ` ,
765+ ) ;
768766 throw error ;
769767 }
768+ } finally {
769+ // Only clean up if this is still the active compilation
770+ if ( entry . compilation ?. triggerToken === triggerToken ) {
771+ getLogger ( ) . log ( "Cleaning up compilation status." ) ;
772+ entry . compilation = null ;
773+ entry . abortCompilation = null ;
774+ }
770775 }
771- } catch ( e ) {
772- console . error ( e ) ;
773776 } finally {
774777 onCompilationFinished ?.( ) ;
775778 }
You can’t perform that action at this time.
0 commit comments