diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-04 16:32:16 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-04 16:32:16 -0500 |
| commit | 73c81a00a10766900318d86640249d1b54c6b351 (patch) | |
| tree | 793f9c858060591c34813af05e84c7a6a5442153 /tests/test-wttrin-fetch-raw-string.el | |
| parent | a77a7b86f45ae96ff1802ea6f8b87dafd46b17b0 (diff) | |
| download | emacs-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 'tests/test-wttrin-fetch-raw-string.el')
| -rw-r--r-- | tests/test-wttrin-fetch-raw-string.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-wttrin-fetch-raw-string.el b/tests/test-wttrin-fetch-raw-string.el index 34db7f9..e775025 100644 --- a/tests/test-wttrin-fetch-raw-string.el +++ b/tests/test-wttrin-fetch-raw-string.el @@ -47,7 +47,7 @@ (lambda (_url callback) (funcall callback "weather response")))) (wttrin-fetch-raw-string "Paris" - (lambda (data) (setq received-data data))) + (lambda (data &optional _error-msg) (setq received-data data))) (should (equal received-data "weather response")))) (test-wttrin-fetch-raw-string-teardown))) |
