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

Handle invalid layout in a graceful way #41

Open
wengxt opened this issue Feb 24, 2025 · 1 comment · May be fixed by #43
Open

Handle invalid layout in a graceful way #41

wengxt opened this issue Feb 24, 2025 · 1 comment · May be fixed by #43

Comments

@wengxt
Copy link

wengxt commented Feb 24, 2025

I recently came across an issue that crashes the engine and requires me to delete the Keyboard.conf.

Sorry I don't have a real conf file example since I didn't create a backup, but I can reproduce the issue by manually create a invalid config (pass a non existent layout name).

This is bad, because it can happen if openbangla decide to deprecate&remove or rename a layout, or user removed a customized layout.

riti provides a C style api so I think it better handle any issue with return value, or catch any possible exception within rust code boundary.

@wengxt
Copy link
Author

wengxt commented Feb 24, 2025

Example backtrace I got when using this invalid config

$ cat ~/.config/OpenBangla/Keyboard.conf

[layout]
name=Avro Phonetic
path=avro_phonetic1
thread '<unnamed>' panicked at src/fixed/method.rs:108:66:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@mominul mominul linked a pull request Mar 2, 2025 that will close this issue
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 a pull request may close this issue.

1 participant