emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/plz 1aad476df9 33/40: Fix: Replace string in error data


From: ELPA Syncer
Subject: [elpa] externals/plz 1aad476df9 33/40: Fix: Replace string in error data
Date: Mon, 26 Jun 2023 06:59:34 -0400 (EDT)

branch: externals/plz
commit 1aad476df949b75f2a484b2c88de2a6afc2a5505
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Fix: Replace string in error data
    
    For compatibility with plz v0.6 and earlier.  In plz v0.8, the error
    data will be a list of only the plz-error struct.
---
 plz.el            | 4 ++--
 tests/test-plz.el | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/plz.el b/plz.el
index 49c515acf1..b507a4de3b 100644
--- a/plz.el
+++ b/plz.el
@@ -525,8 +525,8 @@ NOQUERY is passed to `make-process', which see.
                      ;; outside of the sentinel.
                      (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))))
+                         (signal 'plz-http-error (list "HTTP error" data))
+                       (signal 'plz-curl-error (list "Curl error" data))))
                     (else
                      ;; The AS function returned a value: return it.
                      else)))
diff --git a/tests/test-plz.el b/tests/test-plz.el
index 201faf3385..f420847130 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -423,7 +423,7 @@ Also, any instance of \"URI-PREFIX\" in URL-PART is 
replaced with
 
 (plz-deftest plz-get-curl-error-sync nil
   ;; Sync.
-  (pcase-let ((`(,_signal . (,data))
+  (pcase-let ((`(,_signal . (,_message ,data))
               (should-error (plz 'get "https://httpbinnnnnn.org/get/status/404";
                                :as 'string :then 'sync)
                              :type 'plz-error)))
@@ -432,7 +432,7 @@ Also, any instance of \"URI-PREFIX\" in URL-PART is 
replaced with
                    (plz-error-curl-error data)))))
 
 (plz-deftest plz-get-404-error-sync  nil
-  (pcase-let ((`(,_signal . (,data))
+  (pcase-let ((`(,_signal . (,_message ,data))
               (should-error (plz 'get (plz-test-url "/get/status/404")
                               :as 'string :then 'sync)
                              :type 'plz-error)))
@@ -453,7 +453,7 @@ Also, any instance of \"URI-PREFIX\" in URL-PART is 
replaced with
 
 (plz-deftest plz-get-timeout-error-sync nil
   (pcase-let* ((start-time (current-time))
-               (`(,_signal . (,(cl-struct plz-error (curl-error `(,code . 
,message)))))
+               (`(,_signal . (,_message ,(cl-struct plz-error (curl-error 
`(,code . ,message)))))
                (should-error (plz 'get (plz-test-url "/delay/5")
                                :as 'string :then 'sync :timeout 1)
                              :type 'plz-error))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]