Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Use anyhow context, bail, and ensure instead of panicking#63044

Merged
keynmol merged 1 commit into
mainfrom
scip-syntax-cli-use-anyhow
Jun 3, 2024
Merged

Use anyhow context, bail, and ensure instead of panicking#63044
keynmol merged 1 commit into
mainfrom
scip-syntax-cli-use-anyhow

Conversation

@keynmol

@keynmol keynmol commented Jun 3, 2024

Copy link
Copy Markdown
Contributor

I was indexing some projects and occasionally it'd fail with

thread 'main' panicked at crates/syntax-analysis/src/globals.rs:191:17:
declare only one scope per match
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

With no extra information, circumventing the error handling in the levels above.

This PR uses anyhow's helpers to ensure that the errors are propagated

Test plan

  • N/A

@keynmol keynmol requested a review from kritzcreek June 3, 2024 14:36
@cla-bot cla-bot Bot added the cla-signed label Jun 3, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jun 3, 2024

@kritzcreek kritzcreek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@keynmol keynmol merged commit 2230a80 into main Jun 3, 2024
@keynmol keynmol deleted the scip-syntax-cli-use-anyhow branch June 3, 2024 14:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants