1- import { CompilerErrorNamespace , CompilerErrorSeverity , CompilerEvent , CompilerMessageSpec as m , compilerExceptionToString as exc } from "@keymanapp/common-types" ;
1+ import { CompilerErrorNamespace , CompilerErrorSeverity , CompilerEvent , CompilerMessageSpec as m } from "@keymanapp/common-types" ;
22
33const Namespace = CompilerErrorNamespace . KmnCompiler ;
44const SevInfo = CompilerErrorSeverity . Info | Namespace ;
@@ -46,20 +46,21 @@ export const enum KmnCompilerMessageRanges {
4646 are reserved for kmcmplib messages.
4747*/
4848export class CompilerMessages {
49- static Fatal_UnexpectedException = ( o :{ e : any } ) => m ( this . FATAL_UnexpectedException , `Unexpected exception: ${ exc ( o . e ) } ` ) ;
49+ static Fatal_UnexpectedException = ( o :{ e : any } ) => m ( this . FATAL_UnexpectedException , null , o . e ?? 'unknown error' ) ;
5050 static FATAL_UnexpectedException = SevFatal | 0x900 ;
5151
52- static Fatal_MissingWasmModule = ( o :{ e ?: any } ) => m ( this . FATAL_MissingWasmModule , `Could not instantiate WASM compiler module or initialization failed: ${ exc ( o . e ) } ` ) ;
52+ static Fatal_MissingWasmModule = ( o :{ e ?: any } ) => m ( this . FATAL_MissingWasmModule ,
53+ `Could not instantiate WASM compiler module or initialization failed` , o . e ?? 'unknown error' ) ;
5354 static FATAL_MissingWasmModule = SevFatal | 0x901 ;
5455
5556 // TODO: Is this now deprecated?
56- static Fatal_UnableToSetCompilerOptions = ( ) => m ( this . FATAL_UnableToSetCompilerOptions , `Unable to set compiler options` ) ;
57+ static Fatal_UnableToSetCompilerOptions = ( ) => m ( this . FATAL_UnableToSetCompilerOptions , null , `Unable to set compiler options` ) ;
5758 static FATAL_UnableToSetCompilerOptions = SevFatal | 0x902 ;
5859
59- static Fatal_CallbacksNotSet = ( ) => m ( this . FATAL_CallbacksNotSet , `Callbacks were not set with init` ) ;
60+ static Fatal_CallbacksNotSet = ( ) => m ( this . FATAL_CallbacksNotSet , null , `Callbacks were not set with init` ) ;
6061 static FATAL_CallbacksNotSet = SevFatal | 0x903 ;
6162
62- static Fatal_UnicodeSetOutOfRange = ( ) => m ( this . FATAL_UnicodeSetOutOfRange , `UnicodeSet buffer was too small` ) ;
63+ static Fatal_UnicodeSetOutOfRange = ( ) => m ( this . FATAL_UnicodeSetOutOfRange , null , `UnicodeSet buffer was too small` ) ;
6364 static FATAL_UnicodeSetOutOfRange = SevFatal | 0x904 ;
6465
6566 static Error_UnicodeSetHasStrings = ( ) => m ( this . ERROR_UnicodeSetHasStrings , `UnicodeSet contains strings, not allowed` ) ;
@@ -72,19 +73,19 @@ export class CompilerMessages {
7273 static ERROR_UnicodeSetSyntaxError = SevError | 0x907 ;
7374
7475 static Error_InvalidKvksFile = ( o :{ filename : string , e : any } ) => m ( this . ERROR_InvalidKvksFile ,
75- `Error encountered parsing ${ o . filename } : ${ o . e } ` ) ;
76+ `Error encountered parsing ${ o . filename } : ${ o . e ?? 'unknown error' } ` ) ; // Note, not fatal, not reporting to Sentry
7677 static ERROR_InvalidKvksFile = SevError | 0x908 ;
7778
7879 static Warn_InvalidVkeyInKvksFile = ( o :{ filename : string , invalidVkey : string } ) => m ( this . WARN_InvalidVkeyInKvksFile ,
7980 `Invalid virtual key ${ o . invalidVkey } found in ${ o . filename } ` ) ;
8081 static WARN_InvalidVkeyInKvksFile = SevWarn | 0x909 ;
8182
8283 static Error_InvalidDisplayMapFile = ( o :{ filename : string , e : any } ) => m ( this . ERROR_InvalidDisplayMapFile ,
83- `Error encountered parsing display map ${ o . filename } : ${ o . e } ` ) ;
84+ `Error encountered parsing display map ${ o . filename } : ${ o . e ?? 'unknown error' } ` ) ; // Note, not fatal, not reporting to Sentry
8485 static ERROR_InvalidDisplayMapFile = SevError | 0x90A ;
8586
8687 static Error_InvalidKvkFile = ( o :{ filename : string , e : any } ) => m ( this . ERROR_InvalidKvkFile ,
87- `Error encountered loading ${ o . filename } : ${ o . e } ` ) ;
88+ `Error encountered loading ${ o . filename } : ${ o . e ?? 'unknown error' } ` ) ; // Note, not fatal, not reporting to Sentry
8889 static ERROR_InvalidKvkFile = SevError | 0x90B ;
8990} ;
9091
0 commit comments