Stop unnecessary exceptions from being thrown from crossgen when a reference is not actually a managed dll#70191
Conversation
davidwrighton
commented
Jun 3, 2022
- Makes ad hoc usage of crossgen2 much more convenient on Windows as the exceptions generated are annoying to deal with in the debugger
…ference is not actually a managed dll - Makes ad hoc usage of crossgen2 much more convenient on Windows as the exceptions generated are annoying to deal with in the debugger
| try | ||
| { | ||
| EcmaModule module = _typeSystemContext.GetModuleFromPath(referenceFile); | ||
| EcmaModule module = _typeSystemContext.GetModuleFromPath(referenceFile, throwOnFailureToLoad: false); |
There was a problem hiding this comment.
Do we still need this to be in a try/catch (catch { } // Ignore non-managed pe files)? Same question for below.
There was a problem hiding this comment.
I think that we still need a try/catch block. I'm really trying to reduce the number of weirdo useless exceptions, not get rid of them entirely. I'm not prepared at the moment to actually attempt to get rid of all of the exception paths that are possible (or at least make sure they are only present for cases where we'd like to kill the entire debugging process.
trylek
left a comment
There was a problem hiding this comment.
LGTM modulo Michal's comment I believe to be valid - we either need a catch block within AddModule or keep this one. Should be easy to test using the IJW runtime tests.