Skip to content

Improve error message when we pass a directory to debug-files check#2034

Merged
szokeasaurusrex merged 2 commits intomasterfrom
szokeasaurusrex/check-directory-error
Apr 22, 2024
Merged

Improve error message when we pass a directory to debug-files check#2034
szokeasaurusrex merged 2 commits intomasterfrom
szokeasaurusrex/check-directory-error

Conversation

@szokeasaurusrex
Copy link
Copy Markdown
Member

See #2033.

Currently, the debug-files check command only supports checking individual files. However, the error message we emit when passing a directory is a very vague error: Unsupported file. This change improves the error message. We should still consider #2033's suggestion of supporting recursive search through directories for this command.

See #2033. This is intended as a quick fix for the issue; we should still consider implementing the recursive check functionality suggested in #2033, since it would provide a better user experience.
This test verifies that the `sentry-cli debug-files check` command results in an error with a meaningful message when the path passed leads to a directory.
@szokeasaurusrex szokeasaurusrex requested a review from elramen April 19, 2024 09:57
Copy link
Copy Markdown
Member

@elramen elramen left a comment

Choose a reason for hiding this comment

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

Looks great!

@szokeasaurusrex
Copy link
Copy Markdown
Member Author

Thanks for the review, @elramen! @Swatinem and @loewenheim, I would also appreciate a review from one of you, since @elramen is new to CLI code reviews.

Copy link
Copy Markdown
Contributor

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

code looks good.
this is a bit surprising though, other commands treat the path argument as a glob pattern and will recurse into subdirectories and even zip files in some cases.

@szokeasaurusrex
Copy link
Copy Markdown
Member Author

@Swatinem yeah, that's what I thought too. I would like to implement similar behavior here, this is a quick fix until I get around to that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants