-
Notifications
You must be signed in to change notification settings - Fork 478
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
Graceful recovery from JSON errors in custom blocks #1484
Comments
This is a problem with all the other blocks as well: a broken block should not crash the entire bar. This is solved in async branch. For the reasons why this branch exists, refer to #430 and #1440.
While developing a block, you can create a keybinding to restart i3status-rs in-place by running PRs are welcome. |
Thanks for quick reply. I can wait as long as need, no rush. If async branch is solving not only whole bar break but also recovery on next retrieval, you can close this issue. I reported it because I didn't see any relevant issue opened.
I didn't mean "easier to develop" as during the development, but the fact you don't have to handle all exceptions. Example: I'm currently hitting this problem with some elisp code which has to be executed in running emacs instance. It is working great until I'm (re)starting that Emacs. For one second it returns something else then valid json and I have to restart status bar. And yeah, I can get some layer between to handle this exception.. but then it won't be so easy.
Sorry, but I'm already struggling with too much languages problem and this issue doesn't seem to fit in trivial fix category. |
No, not yet, but it can be trivially implemented by wrapping the logic with
No problem. |
I don't expect that branch to be merged any time soon, so... |
😉 Closing this since master is now async. |
Yay! But it's not implemented yet :) |
Ah my bad, I conflated it with the recoverable blocks. |
Currently, when you have custom block witth
json
set totrue
and it returns non-json, whole bar simply breaks.Documentation is quite clear, that you can expect something similar, but I belive that it would be much better to recover from such errors. I think following approach would be much better.
error
text in red would be enough IMHO.interval
It would make custom block much easier to develop. Thanks for considering this.
The text was updated successfully, but these errors were encountered: