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

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

[elpa] externals/plz 40ec2e97da 2/3: Add: plz-error signal


From: ELPA Syncer
Subject: [elpa] externals/plz 40ec2e97da 2/3: Add: plz-error signal
Date: Mon, 26 Jun 2023 03:59:20 -0400 (EDT)

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

    Add: plz-error signal
    
    The other signals, plz-curl-error and plz-http-error, inherit from
    plz-error.  In v0.8 of plz, only plz-error will be defined, so
    applications should be updated while using plz v0.7 to only handle the
    plz-error signal.
---
 README.org |  5 ++++-
 plz.el     | 20 ++++++++++++++++++--
 plz.info   | 40 ++++++++++++++++++++++++----------------
 3 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/README.org b/README.org
index 034db4354d..df87ca0f71 100644
--- a/README.org
+++ b/README.org
@@ -181,7 +181,10 @@ You may also clear a queue with ~plz-clear~, which cancels 
any active or queued
 
 ** 0.7-pre
 
-Nothing new yet.
+*Changes*
++ A new error signal, ~plz-error~, is defined.  The existing signals, 
~plz-curl-error~ and ~plz-http-error~, inherit from it, so handling ~plz-error~ 
catches both.
+
+  *NOTE:* The existing signals, ~plz-curl-error~ and ~plz-http-error~, are 
hereby deprecated, and they will be removed in v0.8.  Applications should be 
updated while using v0.7 to only expect ~plz-error~.
 
 ** 0.6
 
diff --git a/plz.el b/plz.el
index b966cf8de0..48901e7a37 100644
--- a/plz.el
+++ b/plz.el
@@ -46,6 +46,14 @@
 
 ;;;; Usage:
 
+;; FIXME: Remove the following note in v0.8.
+
+;; NOTE: In v0.8 of plz, only one error will be signaled: `plz-error'.
+;; The existing errors, `plz-curl-error' and `plz-http-error', inherit
+;; from `plz-error' to allow applications to update their code while
+;; using v0.7 (i.e. any `condition-case' forms should now handle only
+;; `plz-error', not the other two).
+
 ;; Call function `plz' to make an HTTP request.  Its docstring
 ;; explains its arguments.  `plz' also supports other HTTP methods,
 ;; uploading and downloading binary files, sending URL parameters and
@@ -96,8 +104,9 @@
 ;;;; Errors
 
 ;; FIXME: `condition-case' can't catch these...?
-(define-error 'plz-curl-error "plz: Curl error")
-(define-error 'plz-http-error "plz: HTTP error")
+(define-error 'plz-error "plz error")
+(define-error 'plz-curl-error "plz: Curl error" 'plz-error)
+(define-error 'plz-http-error "plz: HTTP error" 'plz-error)
 
 ;;;; Structs
 
@@ -323,6 +332,12 @@ fails, either `plz-curl-error' or `plz-http-error' as
 appropriate, 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
+`plz-http-error', inherit from `plz-error' to allow applications
+to update their code while using v0.7 (i.e. any `condition-case'
+forms should now handle only `plz-error', not the other two).
+
 FINALLY is an optional function called without argument after
 THEN or ELSE, as appropriate.  For synchronous requests, this
 argument is ignored.
@@ -332,6 +347,7 @@ how long it takes to connect to a host and to receive a 
response
 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.
   ;; Inspired by and copied from `elfeed-curl-retrieve'.
   (declare (indent defun))
   (setf decode (if (and decode-s (not decode))
diff --git a/plz.info b/plz.info
index cd9f92b36b..f147ec039e 100644
--- a/plz.info
+++ b/plz.info
@@ -301,7 +301,15 @@ File: README.info,  Node: 07-pre,  Next: 06,  Up: Changelog
 3.1 0.7-pre
 ===========
 
-Nothing new yet.
+*Changes*
+   • A new error signal, ‘plz-error’, is defined.  The existing signals,
+     ‘plz-curl-error’ and ‘plz-http-error’, inherit from it, so handling
+     ‘plz-error’ catches both.
+
+     *NOTE:* The existing signals, ‘plz-curl-error’ and
+     ‘plz-http-error’, are hereby deprecated, and they will be removed
+     in v0.8.  Applications should be updated while using v0.7 to only
+     expect ‘plz-error’.
 
 
 File: README.info,  Node: 06,  Next: 054,  Prev: 07-pre,  Up: Changelog
@@ -506,21 +514,21 @@ Node: Queueing6859
 Node: Tips8242
 Node: Changelog8543
 Node: 07-pre8812
-Node: 068918
-Node: 0549533
-Node: 0539776
-Node: 05210092
-Node: 05110299
-Node: 0510551
-Node: 0410757
-Node: 0311663
-Node: 02112111
-Node: 0212262
-Node: 0112393
-Node: Credits12489
-Node: Development12855
-Node: Copyright assignment13369
-Node: License13957
+Node: 069342
+Node: 0549957
+Node: 05310200
+Node: 05210516
+Node: 05110723
+Node: 0510975
+Node: 0411181
+Node: 0312087
+Node: 02112535
+Node: 0212686
+Node: 0112817
+Node: Credits12913
+Node: Development13279
+Node: Copyright assignment13793
+Node: License14381
 
 End Tag Table
 



reply via email to

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