Skip to content
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

Merged
merged 3 commits into from
May 27, 2024

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented May 23, 2024

@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")
Copy link
Contributor Author

@andyw8 andyw8 May 23, 2024

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.

@andyw8 andyw8 added enhancement New feature or request bugfix This PR will fix an existing bug labels May 23, 2024
@andyw8 andyw8 changed the title Expand addon error information Expand addon error information when addon activation fails May 23, 2024
@andyw8 andyw8 changed the title Expand addon error information when addon activation fails Expand addon error information for when addon activation fails May 23, 2024
@andyw8 andyw8 marked this pull request as ready for review May 23, 2024 15:00
@andyw8 andyw8 requested a review from a team as a code owner May 23, 2024 15:00
@andyw8 andyw8 requested review from st0012 and vinistock May 23, 2024 15:00
@@ -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"))
Copy link
Contributor Author

@andyw8 andyw8 May 23, 2024

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.

@andyw8 andyw8 added server This pull request should be included in the server gem's release notes and removed bugfix This PR will fix an existing bug labels May 23, 2024
lib/ruby_lsp/addon.rb Outdated Show resolved Hide resolved
andyw8 and others added 2 commits May 27, 2024 15:30
@andyw8 andyw8 enabled auto-merge (squash) May 27, 2024 19:50
@andyw8 andyw8 merged commit 65752c4 into main May 27, 2024
33 checks passed
@andyw8 andyw8 deleted the andyw8/expand-addon-error-information branch May 27, 2024 19:53
andyw8 added a commit that referenced this pull request May 29, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants