-
Notifications
You must be signed in to change notification settings - Fork 64
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
Migrator obscures stack trace of unhandled exceptions #422
Comments
Hey @digitalcora Welcome to Lucky! Sorry you ran in to some issues. Hopefully you got it all set now. That is a good call. Normally when we catch errors like that, it's because we can usually provide a better error message than the one provided by Crystal's default. In this case since we're just re-raising the same error, I'm not seeing any benefit to having it. My guess is that it would be ok to remove those. What are your thoughts @paulcsmith ? |
I think the original reason was to highlight the error in red. But if it makes the stacktrace worse then we should remove it :D Thanks for opening the issue @digitalcora! |
These are also places I believe are obscuring problems during migrations: avram/src/avram/migrator/runner.cr Lines 192 to 193 in 1e6f4ed
avram/src/avram/migrator/migration.cr Lines 99 to 108 in 1e6f4ed
|
Trying to set up a Lucky project for the first time, I ran into a strange error that took quite a while to debug. Part of the difficulty was that it turned out Avram was suppressing the real stack trace of the error.
in https://github.com/luckyframework/avram/blob/63be781/src/avram/migrator/migrator.cr:
The marked lines catch all exceptions and re-raise them, with a stack trace pointing here instead of the original source. The purpose of these lines is unclear to me, and in fact once I deleted them from my project's copy of Avram in
lib
, I got a much better stack trace that allowed me to solve the problem.If there would be no harm in doing so, maybe these lines could be removed?
The text was updated successfully, but these errors were encountered: