aboutsummaryrefslogtreecommitdiff
path: root/wttrin-debug.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-04 16:32:16 -0500
committerCraig Jennings <c@cjennings.net>2026-04-04 16:32:16 -0500
commit73c81a00a10766900318d86640249d1b54c6b351 (patch)
tree793f9c858060591c34813af05e84c7a6a5442153 /wttrin-debug.el
parenta77a7b86f45ae96ff1802ea6f8b87dafd46b17b0 (diff)
downloademacs-wttrin-73c81a00a10766900318d86640249d1b54c6b351.tar.gz
emacs-wttrin-73c81a00a10766900318d86640249d1b54c6b351.zip
feat: specific error messages for fetch failures
Add HTTP status code checking (wttrin--extract-http-status) and pass error descriptions through the callback chain so users see "Location not found (HTTP 404)" or "Network error — check your connection" instead of the generic "Perhaps the location was misspelled?" for every failure. Also fix pre-existing bug where the condition-case error handler in extract-response-body killed an unrelated buffer after unwind-protect already cleaned up. 330 tests (was 307), all passing.
Diffstat (limited to 'wttrin-debug.el')
-rw-r--r--wttrin-debug.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/wttrin-debug.el b/wttrin-debug.el
index d0473dd..53f7e29 100644
--- a/wttrin-debug.el
+++ b/wttrin-debug.el
@@ -45,7 +45,7 @@ Always fetches fresh data from the API, bypassing cache."
(let ((wttrin--force-refresh t))
(wttrin--get-cached-or-fetch
location
- (lambda (raw-string)
+ (lambda (raw-string &optional _error-msg)
(with-current-buffer (get-buffer-create "*wttrin-debug*")
(erase-buffer)
(when raw-string