INNER CODE UNIT · Python
_handle_api_error
Kohei-Wada/taskdog · packages/taskdog-ui/src/taskdog/tui/app.py:472
def _handle_api_error(
self, error: ServerConnectionError | AuthenticationError | ServerError
) -> None:
"""Handle API errors from TaskUIManager.
Args:
error: API error (connection, auth, or server error)
"""
if isinstance(error, ServerConnectionError):
msg = f"Server connection failed: {error.original_error.__class__.__name__}. Press 'r' to retry."
elif isinstance(error, AuthenticationError):
msg = f"Authentication failed: {error}. Check your API key."
else:
msg = f"Server error: {error}. Press 'r' to retry."
self.notify(msg, severity="error", timeout=10)
def search_sort(self) -> None:
"""Show a fuzzy search command palette containing all sort options.