-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should try not to panic on error but always exist with a reasonable error #1174
Comments
what would you suggest to do instead of the panics? |
Skipping diagnostics is indeed not a good idea, so I'm still open for something like the critical level we had before. But I still think that instead of a panic, we could return a result and exit with a meaningful error. |
To me this sounds more like an either/or situation - if we introduce critical diagnostics with a fixed severity, then we no longer need to change the unreachable statements in codegen into results.
Isn't that only due to the changes to the configurable diagnostics? We initially decided to introduce On the flipside, If we decide to keep the diagnostics as they are now, codegen needs to fail gracefully - but then we wouldn't need to worry about introducing a critical/immutable severity anymore. Of course doing both is also an option, to me it just feels kind of redundant. |
Would we adding a diagnostic here that says: "Cannot do this & that. Please configure err123 as cirtical?". I even wonder if it is clear which ignore-rule lead to this situation? |
#1168 happens because an error was ignored, which led the codegen into an unreachable state.
This brings up 2 issues:
I would create a separate issue for the error configuration.
This issue is to handle codegen panics. We have a lot of "unreachable" blocks that are not really unreachable. We should try to fail gracefully here, we could return the same error code in that stage to explain that ignoring the original error caused this.
I would also do similar things to the expect keywords we have, or change them to the anyhow equivalent.
The text was updated successfully, but these errors were encountered: