zulip-terminal
zulip-terminal copied to clipboard
Handle timeout exception when fetching raw message.
What does this PR do, and why?
ZT freezes when connection is lost while fetching data from the server. This PR attempts to notify the user better about the connection loss by displaying an error message.
Outstanding aspect(s)
We are still open to suggestion about new ways to notify users better about this error. Ideally we'd like to improve interactivity by displaying a loading message till connection comes back, if it does.
External discussion & connections
- [x] Discussed in #zulip-terminal in
topicZT freezes while connection is lost #T1381 - [ ] Fully fixes #
- [x] Partially fixes issue #1381
- [ ] Builds upon previous unmerged work in PR #
- [ ] Is a follow-up to work in PR #
- [ ] Requires merge of PR #
- [ ] Merge will enable work on #
How did you test this?
- [x] Manually - Behavioral changes
- [x] Manually - Visual changes
- [x] Adapting existing automated tests
- [x] Adding automated tests for new behavior (or missing tests)
- [ ] Existing automated tests should already cover this (only a refactor of tested code)
Self-review checklist for each commit
- [x] It is a minimal coherent idea
- [x] It has a commit summary following the documented style (title & body)
- [x] It has a commit summary describing the motivation and reasoning for the change
- [x] It individually passes linting and tests
- [x] It contains test additions for any new behavior
- [x] It flows clearly from a previous branch commit, and/or prepares for the next commit
Visual changes
@Sushmey Thanks for looking at these issues. I responded to this in the stream.
Note that the first commit doesn't specifically return a default error response - it passes on the exception it obtained back to the caller.