File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Source/ExcelDna.IntelliSense/UIMonitor Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ public static string GetFormulaEditPrefix()
5656 if ( result != 0 )
5757 {
5858 Logger . WindowWatcher . Warn ( $ "LPenHelper Failed. Result: { result } ") ;
59- throw new InvalidOperationException ( "LPenHelper Failed. Result: " + result ) ;
59+ // This exception is poorly handled when it happens in the SyncMacro
60+ // We only expect the error to happen during shutdown, in which case we might as well
61+ // handle this asif no formula is being edited
62+ // throw new InvalidOperationException("LPenHelper Failed. Result: " + result);
63+ return null ;
6064 }
6165 if ( fmlaInfo . wPointMode == xlModeReady )
6266 {
@@ -72,9 +76,15 @@ public static string GetFormulaEditPrefix()
7276 }
7377 catch ( AccessViolationException )
7478 {
75- Logger . WindowWatcher . Warn ( "LPenHelper Access Violation!" ) ;
79+ Logger . WindowWatcher . Warn ( "LPenHelper - Access Violation!" ) ;
7680 return null ;
7781 }
82+ catch ( Exception ex )
83+ {
84+ // Some unexpected error - for now we log as an error and re-throw
85+ Logger . WindowWatcher . Error ( ex , "LPenHelper - Unexpected Error" ) ;
86+ throw ;
87+ }
7888 }
7989 }
8090}
You can’t perform that action at this time.
0 commit comments