Prevent hangs on internal errors#4126
Conversation
6c0e5f0 to
69ac52c
Compare
69ac52c to
6e56f51
Compare
|
I think |
|
The code looks reasonable but I'm a little bit hesitant to approve, just because of where this change is. Does this change only appear to affect the unit tests, or does it affect running the compiler normally as well? |
The error will get tagged with the source position of the thing it was checking when the internal error occured. This is incredibly useful. |
|
Ok, that is very convincing. So maybe the approach should be “use |
It does affect the compiler running normally, but in a less dramatic way. Based on my tests, prior to this patch, an internal error usually causes the compiler to print only the error itself and |
hdgarrood
left a comment
There was a problem hiding this comment.
Ok then, that also sounds like an improvement.
Description of the change
Sometimes, when one of our unit tests results in an internal error, the entire test process hangs. This is mildly annoying, and I think this PR is the appropriate fix? I have to confess that I don't have as solid an understanding of how
MonadBaseControlworks as I'd like. Also, our whole internal error story is kind of confusing to me—we haveinternalError, but alsointernalCompilerError, and a few instances oferrorscattered about to boot. I don't know if further enabling using the exception-based error functions instead of encouraging more use of the monadicinternalCompilerErroris the right thing to do.Buuuuuut... this fix is quick and not too disruptive to the status quo, so I'm proposing it!
Checklist: