-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix exception output capturing #482
Conversation
c987284
to
d1f04bc
Compare
rescue => e | ||
send_message({ error: e.full_message(highlight: false) }) | ||
log_message("Request #{request_name} failed:\n" + e.full_message(highlight: false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vinistock I updated this so that we show the request name for both rescue
clauses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
@@ -119,12 +119,17 @@ def execute(request, params) | |||
require params[:server_addon_path] | |||
ServerAddon.finalize_registrations!(@stdout) | |||
when "server_addon/delegate" | |||
server_addon_name = params.delete(:server_addon_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to avoid deleting the params here since they may be needed in the error message.
rescue => e | ||
send_message({ error: e.full_message(highlight: false) }) | ||
log_message("Request #{request_name} failed:\n" + e.full_message(highlight: false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log_message
just writes to $stderr, which we are already capturing.
FYI @KaanOzkan |
Closes https://github.com/Shopify/team-ruby-dx/issues/1297
This ensure the failure output can be displayed in the Ruby LSP output panel.
To 🎩 :
dev down
on CoreNote: Failures that were previously silent, such as hovering over a ActiveRecord model when the DB isn't set up, will now show in the logs.