[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz b04b466d79 19/40: Change: Signal plz-curl/http-erro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz b04b466d79 19/40: Change: Signal plz-curl/http-error again |
Date: |
Mon, 26 Jun 2023 06:59:33 -0400 (EDT) |
branch: externals/plz
commit b04b466d797e671e2c22ca15b69dc80c5b850047
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: Signal plz-curl/http-error again
For v0.7 of plz.
---
plz.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/plz.el b/plz.el
index f06be9aef8..b51193a2f1 100644
--- a/plz.el
+++ b/plz.el
@@ -326,10 +326,11 @@ directly from this function.
ELSE is an optional callback function called when the request
fails (i.e. if curl fails, or if the HTTP response has a non-2xx
-status code). It is called with one argument, a `plz-error'
-structure. If ELSE is nil, a `plz-error' is signaled when the
-request fails, with a `plz-error' structure as the error data.
-For synchronous requests, this argument is ignored.
+status code). It is called with one argument, a `plz-error'
+structure. If ELSE is nil, a `plz-curl-error' or
+`plz-http-error' is signaled when the request fails, with a
+`plz-error' structure as the error data. For synchronous
+requests, this argument is ignored.
NOTE: In v0.8 of plz, only one error will be signaled:
`plz-error'. The existing errors, `plz-curl-error' and
@@ -347,6 +348,7 @@ from a host, respectively.
NOQUERY is passed to `make-process', which see."
;; FIXME: Remove the note about error changes from the docstring in v0.8.
+ ;; FIXME: Update error signals in docstring in v0.8.
;; Inspired by and copied from `elfeed-curl-retrieve'.
(declare (indent defun))
(setf decode (if (and decode-s (not decode))
@@ -524,7 +526,10 @@ NOQUERY is passed to `make-process', which see."
;; The AS function signaled an error, which was collected
;; into a `plz-error' struct: re-signal the error here,
;; outside of the sentinel.
- (signal 'plz-error (list data)))
+ (if (plz-error-response data)
+ ;; FIXME: Signal only plz-error in v0.8.
+ (signal 'plz-http-error (list data))
+ (signal 'plz-curl-error (list data))))
(else
;; The AS function returned a value: return it.
else)))
@@ -839,7 +844,7 @@ argument passed to `plz--sentinel', which see."
;; Skip proxy headers (curl apparently offers no way to omit
;; them).
(unless (re-search-forward "\r\n\r\n" nil t)
- (signal 'plz-error '("plz--response: End of proxy headers not
found")))))))
+ (signal 'plz-http-error '("plz--response: End of proxy headers not
found")))))))
(defun plz--skip-redirect-headers ()
"Skip HTTP redirect headers in current buffer."
@@ -848,7 +853,7 @@ argument passed to `plz--sentinel', which see."
;; Skip redirect headers ("--dump-header" forces redirect headers to be
included
;; even when used with "--location").
(or (re-search-forward "\r\n\r\n" nil t)
- (signal 'plz-error '("plz--response: End of redirect headers not
found")))))
+ (signal 'plz-http-error '("plz--response: End of redirect headers not
found")))))
(cl-defun plz--response (&key (decode-p t))
"Return response structure for HTTP response in current buffer.
@@ -859,7 +864,7 @@ Assumes that point is at beginning of HTTP response."
(save-excursion
;; Parse HTTP version and status code.
(unless (looking-at plz-http-response-status-line-regexp)
- (signal 'plz-error
+ (signal 'plz-http-error
(list "plz--response: Unable to parse HTTP response status line"
(buffer-substring (point) (line-end-position)))))
(let* ((http-version (string-to-number (match-string 1)))
@@ -912,7 +917,7 @@ Assumes point is at start of HTTP response."
"Narrow to body of HTTP response in current buffer.
Assumes point is at start of HTTP response."
(unless (re-search-forward plz-http-end-of-headers-regexp nil t)
- (signal 'plz-error '("plz--narrow-to-body: Unable to find end of
headers")))
+ (signal 'plz-http-error '("plz--narrow-to-body: Unable to find end of
headers")))
(narrow-to-region (point) (point-max)))
;;;; Footer
- [elpa] externals/plz b896c41d71 32/40: Change: Generate buffer for STDERR, (continued)
- [elpa] externals/plz b896c41d71 32/40: Change: Generate buffer for STDERR, ELPA Syncer, 2023/06/26
- [elpa] externals/plz d2a7368699 37/40: Tidy: (plz) Don't switch to process-buffer, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 9319470060 38/40: Merge branch 'wip/no-signal-from-sentinel-as-timer', ELPA Syncer, 2023/06/26
- [elpa] externals/plz 5e63662e21 40/40: Docs: Update changelog, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 0cb20bc74d 03/40: Tidy, ELPA Syncer, 2023/06/26
- [elpa] externals/plz e28b4e8b6a 06/40: Tidy, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 8f263bfd0f 09/40: Comment: Remove old TODO, ELPA Syncer, 2023/06/26
- [elpa] externals/plz c181fd1565 10/40: Tidy: Error handling in THEN function, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 4735c8333d 17/40: Fix: (plz) Signal error with data as list, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 260840d3e7 18/40: Change: (plz--respond) Rename from plz--timer, ELPA Syncer, 2023/06/26
- [elpa] externals/plz b04b466d79 19/40: Change: Signal plz-curl/http-error again,
ELPA Syncer <=
- [elpa] externals/plz 5a60113110 21/40: Comment: Add links to bug reports, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 96710ad323 23/40: Tidy, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 7edcd67472 27/40: Change: Set STDERR process and sentinel, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 3576b9820c 28/40: Tidy: Unused arguments, ELPA Syncer, 2023/06/26
- [elpa] externals/plz f94f8af98a 30/40: Tidy: Error message, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 1aad476df9 33/40: Fix: Replace string in error data, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 3dfcbff613 36/40: Change: Use process properties instead of buffer-local variables, ELPA Syncer, 2023/06/26
- [elpa] externals/plz 919d2b8500 39/40: Docs: Update changelog, ELPA Syncer, 2023/06/26