@@ -24,14 +24,24 @@ export class RuntimeCodeMigration extends Migration<ComponentMigrator[], Schemat
24
24
private _hasPossibleTemplateMigrations = true ;
25
25
26
26
override visitNode ( node : ts . Node ) : void {
27
- if ( ts . isSourceFile ( node ) ) {
28
- this . _migrateSourceFileReferences ( node ) ;
29
- } else if ( this . _isComponentDecorator ( node ) ) {
30
- this . _migrateComponentDecorator ( node as ts . Decorator ) ;
31
- } else if ( this . _isImportExpression ( node ) ) {
32
- this . _migrateModuleSpecifier ( node . arguments [ 0 ] ) ;
33
- } else if ( this . _isTypeImportExpression ( node ) ) {
34
- this . _migrateModuleSpecifier ( node . argument . literal ) ;
27
+ try {
28
+ if ( ts . isSourceFile ( node ) ) {
29
+ this . _migrateSourceFileReferences ( node ) ;
30
+ } else if ( this . _isComponentDecorator ( node ) ) {
31
+ this . _migrateComponentDecorator ( node as ts . Decorator ) ;
32
+ } else if ( this . _isImportExpression ( node ) ) {
33
+ this . _migrateModuleSpecifier ( node . arguments [ 0 ] ) ;
34
+ } else if ( this . _isTypeImportExpression ( node ) ) {
35
+ this . _migrateModuleSpecifier ( node . argument . literal ) ;
36
+ }
37
+ } catch ( e ) {
38
+ this . context . logger . error ( `${ e } ` ) ;
39
+ if ( e instanceof Error ) {
40
+ this . logger . error ( `${ e . stack } ` ) ;
41
+ }
42
+ this . context . logger . warn (
43
+ `Failed to process file: ${ node . getSourceFile ( ) . fileName } (see error above).` ,
44
+ ) ;
35
45
}
36
46
}
37
47
0 commit comments