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

Gracefully handle case where the given room ID on the CLI is not valid #59

Open
TeknikalDomain opened this issue Aug 16, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TeknikalDomain
Copy link

Of all the things, I know this is probably... okay, nonexistent on the priority queue, but.

When an invalid / non-existent room ID is given to the -r option, the tool crashes:

# ./synapse_compress_state -p ... -r '!this_is:not.valid'
Fetching state from DB for room '!this_is:not.valid'...
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/database.rs:162:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I learned this when my monthly clean-up script was wrapping room IDs in double quotes, and everything was... unceremoniously failing. It seems like, as just a small user experience enhancement, it might be a good idea to catch this case and gracefully inform that Room '!this_is:not.valid' doesn't exist.

@anoadragon453 anoadragon453 added enhancement New feature or request good first issue Good for newcomers labels Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants