-
Notifications
You must be signed in to change notification settings - Fork 172
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
Expand addon error information for when addon activation fails #2085
Conversation
lib/ruby_lsp/addon.rb
Outdated
@errors.filter_map(&:backtrace).join("\n\n") | ||
def errors_details | ||
@errors.map do |error| | ||
T.must(error.class.name) + ": " + error.message + "\n" + Array(error.backtrace).join("\n") |
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.
I don't believe name
can ever be nil
in this context.
@@ -104,7 +104,7 @@ def load_addons | |||
), | |||
) | |||
|
|||
$stderr.puts(errored_addons.map(&:backtraces).join("\n\n")) | |||
$stderr.puts(errored_addons.map(&:errors_details).join("\n\n")) |
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.
When testing with a raise
on the first line of activate
in an addon, I found that the Notification (line 97) isn't displaying. I'm not entirely sure why that is yet. But I think it's worth writing the error details alongside the backtrace in stderr.
Co-authored-by: Vinicius Stock <[email protected]>
* Expand addon error information * Update lib/ruby_lsp/addon.rb Co-authored-by: Vinicius Stock <[email protected]> * Lint --------- Co-authored-by: Andy Waite <[email protected]> Co-authored-by: Vinicius Stock <[email protected]>
As noted by @st0012 in standardrb/standard#630 (comment)