diff options
| author | Stefan Monnier | 2026-03-09 10:34:05 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2026-03-09 10:34:05 -0400 |
| commit | 0487d68ab9992be4fa70cfd908909001f71e66af (patch) | |
| tree | 8c93da3b94717d184f88277e277de949ecb2fb9c /lisp/net | |
| parent | 798dceb467d4ead092979822f24090c8378f8320 (diff) | |
| download | emacs-scratch/error-API.tar.gz emacs-scratch/error-API.zip | |
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/dbus.el | 8 | ||||
| -rw-r--r-- | lisp/net/eudc-export.el | 4 | ||||
| -rw-r--r-- | lisp/net/imap.el | 4 | ||||
| -rw-r--r-- | lisp/net/soap-client.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 3 | ||||
| -rw-r--r-- | lisp/net/tramp-androidsu.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-crypt.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 13 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 10 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 8 |
11 files changed, 31 insertions, 29 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 465de028725..58d78b14c12 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -245,7 +245,7 @@ Otherwise, return result of last form in BODY, or all other errors." | |||
| 245 | (declare (indent 0) (debug t)) | 245 | (declare (indent 0) (debug t)) |
| 246 | `(condition-case err | 246 | `(condition-case err |
| 247 | (progn ,@body) | 247 | (progn ,@body) |
| 248 | (dbus-error (when dbus-debug (signal (car err) (cdr err)))))) | 248 | (dbus-error (when dbus-debug (signal err))))) |
| 249 | 249 | ||
| 250 | (defvar dbus-event-error-functions | 250 | (defvar dbus-event-error-functions |
| 251 | '(dbus-notice-synchronous-call-errors | 251 | '(dbus-notice-synchronous-call-errors |
| @@ -878,7 +878,7 @@ Example: | |||
| 878 | "AddMatch" rule) | 878 | "AddMatch" rule) |
| 879 | (dbus-error | 879 | (dbus-error |
| 880 | (if (not (string-match-p "eavesdrop" rule)) | 880 | (if (not (string-match-p "eavesdrop" rule)) |
| 881 | (signal (car err) (cdr err)) | 881 | (signal err) |
| 882 | ;; The D-Bus spec says we shall fall back to a rule without eavesdrop. | 882 | ;; The D-Bus spec says we shall fall back to a rule without eavesdrop. |
| 883 | (when dbus-debug (message "Removing eavesdrop from rule %s" rule)) | 883 | (when dbus-debug (message "Removing eavesdrop from rule %s" rule)) |
| 884 | (setq rule (replace-regexp-in-string ",eavesdrop='true'" "" rule t t)) | 884 | (setq rule (replace-regexp-in-string ",eavesdrop='true'" "" rule t t)) |
| @@ -1234,7 +1234,7 @@ If the HANDLER returns a `dbus-error', it is propagated as return message." | |||
| 1234 | ;; Propagate D-Bus error messages. | 1234 | ;; Propagate D-Bus error messages. |
| 1235 | (run-hook-with-args 'dbus-event-error-functions event err) | 1235 | (run-hook-with-args 'dbus-event-error-functions event err) |
| 1236 | (when dbus-debug | 1236 | (when dbus-debug |
| 1237 | (signal (car err) (cdr err)))))) | 1237 | (signal err))))) |
| 1238 | 1238 | ||
| 1239 | (defun dbus-event-bus-name (event) | 1239 | (defun dbus-event-bus-name (event) |
| 1240 | "Return the bus name the event is coming from. | 1240 | "Return the bus name the event is coming from. |
| @@ -1668,7 +1668,7 @@ return nil. | |||
| 1668 | (dbus-error | 1668 | (dbus-error |
| 1669 | (if (string-equal dbus-error-access-denied (cadr err)) | 1669 | (if (string-equal dbus-error-access-denied (cadr err)) |
| 1670 | (car args) | 1670 | (car args) |
| 1671 | (signal (car err) (cdr err)))))) | 1671 | (signal err))))) |
| 1672 | 1672 | ||
| 1673 | (defun dbus-get-all-properties (bus service path interface) | 1673 | (defun dbus-get-all-properties (bus service path interface) |
| 1674 | "Return all properties of INTERFACE at BUS, SERVICE, PATH. | 1674 | "Return all properties of INTERFACE at BUS, SERVICE, PATH. |
diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el index aa8e52bd792..ac212e7a817 100644 --- a/lisp/net/eudc-export.el +++ b/lisp/net/eudc-export.el | |||
| @@ -187,11 +187,11 @@ LOCATION is used as the phone location for BBDB." | |||
| 187 | (bbdb-parse-phone phone) | 187 | (bbdb-parse-phone phone) |
| 188 | (bbdb-parse-phone-number phone))) | 188 | (bbdb-parse-phone-number phone))) |
| 189 | (error | 189 | (error |
| 190 | (if (string= "phone number unparsable." (cadr err)) | 190 | (if (equal "phone number unparsable." (error-slot-value err 1)) |
| 191 | (if (not (y-or-n-p (format "BBDB claims %S to be unparsable--insert anyway? " phone))) | 191 | (if (not (y-or-n-p (format "BBDB claims %S to be unparsable--insert anyway? " phone))) |
| 192 | (error "Phone number unparsable") | 192 | (error "Phone number unparsable") |
| 193 | (setq phone-list (list (bbdb-string-trim phone)))) | 193 | (setq phone-list (list (bbdb-string-trim phone)))) |
| 194 | (signal (car err) (cdr err))))) | 194 | (signal err)))) |
| 195 | (if (= 3 (length phone-list)) | 195 | (if (= 3 (length phone-list)) |
| 196 | (setq phone-list (append phone-list '(nil)))) | 196 | (setq phone-list (append phone-list '(nil)))) |
| 197 | (apply #'vector location phone-list))) | 197 | (apply #'vector location phone-list))) |
diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 22bebbb0f0c..bb298d11d3c 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el | |||
| @@ -1729,11 +1729,11 @@ See `imap-enable-exchange-bug-workaround'." | |||
| 1729 | ;; robust just to check for a BAD response to the | 1729 | ;; robust just to check for a BAD response to the |
| 1730 | ;; attempted fetch. | 1730 | ;; attempted fetch. |
| 1731 | (string-match "The specified message set is invalid" | 1731 | (string-match "The specified message set is invalid" |
| 1732 | (cadr data))) | 1732 | (error-slot-value data 1))) |
| 1733 | (with-current-buffer (or buffer (current-buffer)) | 1733 | (with-current-buffer (or buffer (current-buffer)) |
| 1734 | (setq-local imap-enable-exchange-bug-workaround t) | 1734 | (setq-local imap-enable-exchange-bug-workaround t) |
| 1735 | (imap-fetch (cdr uids) props receive nouidfetch)) | 1735 | (imap-fetch (cdr uids) props receive nouidfetch)) |
| 1736 | (signal (car data) (cdr data)))))) | 1736 | (signal data))))) |
| 1737 | 1737 | ||
| 1738 | (defun imap-message-copyuid-1 (mailbox) | 1738 | (defun imap-message-copyuid-1 (mailbox) |
| 1739 | (if (imap-capability 'UIDPLUS) | 1739 | (if (imap-capability 'UIDPLUS) |
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index f6d2ba229e5..544f0286834 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el | |||
| @@ -3194,7 +3194,7 @@ OPERATION-NAME and PARAMETERS are as described in `soap-invoke'." | |||
| 3194 | (unwind-protect | 3194 | (unwind-protect |
| 3195 | (let ((error-status (plist-get status :error))) | 3195 | (let ((error-status (plist-get status :error))) |
| 3196 | (if error-status | 3196 | (if error-status |
| 3197 | (signal (car error-status) (cdr error-status)) | 3197 | (signal error-status) |
| 3198 | (apply callback | 3198 | (apply callback |
| 3199 | (soap-parse-envelope | 3199 | (soap-parse-envelope |
| 3200 | (soap-parse-server-response) | 3200 | (soap-parse-server-response) |
| @@ -3221,7 +3221,7 @@ OPERATION-NAME and PARAMETERS are as described in `soap-invoke'." | |||
| 3221 | ;; Propagate soap-errors -- they are error replies of the | 3221 | ;; Propagate soap-errors -- they are error replies of the |
| 3222 | ;; SOAP protocol and don't indicate a communication | 3222 | ;; SOAP protocol and don't indicate a communication |
| 3223 | ;; problem or a bug in this code. | 3223 | ;; problem or a bug in this code. |
| 3224 | (signal (car err) (cdr err))) | 3224 | (signal err)) |
| 3225 | (error | 3225 | (error |
| 3226 | (when soap-debug | 3226 | (when soap-debug |
| 3227 | (pop-to-buffer buffer)) | 3227 | (pop-to-buffer buffer)) |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index c20b5df9b59..0184586ba0e 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -629,7 +629,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 629 | (rename-file tmpfile newname ok-if-already-exists) | 629 | (rename-file tmpfile newname ok-if-already-exists) |
| 630 | ((error quit) | 630 | ((error quit) |
| 631 | (delete-file tmpfile) | 631 | (delete-file tmpfile) |
| 632 | (signal (car err) (cdr err)))) | 632 | ;; FIXME: Maybe `unwind-protect' would be better. |
| 633 | (signal err))) | ||
| 633 | 634 | ||
| 634 | ;; Remote newname. | 635 | ;; Remote newname. |
| 635 | (when (and (file-directory-p newname) | 636 | (when (and (file-directory-p newname) |
diff --git a/lisp/net/tramp-androidsu.el b/lisp/net/tramp-androidsu.el index f15c5587651..320163c55d5 100644 --- a/lisp/net/tramp-androidsu.el +++ b/lisp/net/tramp-androidsu.el | |||
| @@ -227,7 +227,7 @@ multibyte mode and waits for the shell prompt to appear." | |||
| 227 | ;; Cleanup, and propagate the signal. | 227 | ;; Cleanup, and propagate the signal. |
| 228 | ((error quit) | 228 | ((error quit) |
| 229 | (tramp-cleanup-connection vec t) | 229 | (tramp-cleanup-connection vec t) |
| 230 | (signal (car err) (cdr err))))))) | 230 | (signal err)))))) |
| 231 | 231 | ||
| 232 | (defun tramp-androidsu-generate-wrapper (function) | 232 | (defun tramp-androidsu-generate-wrapper (function) |
| 233 | "Return connection wrapper function for FUNCTION. | 233 | "Return connection wrapper function for FUNCTION. |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index ecc6fe96855..c42c69af9a5 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -263,7 +263,7 @@ value is the default binding of the variable." | |||
| 263 | ;; * Starting with Emacs 30.1, there is `handler-bind'. Use it | 263 | ;; * Starting with Emacs 30.1, there is `handler-bind'. Use it |
| 264 | ;; instead of `condition-case' when the origin of an error shall be | 264 | ;; instead of `condition-case' when the origin of an error shall be |
| 265 | ;; kept, for example when the HANDLER propagates the error with | 265 | ;; kept, for example when the HANDLER propagates the error with |
| 266 | ;; `(signal (car err) (cdr err)'. | 266 | ;; `(signal err)'. |
| 267 | ;; | 267 | ;; |
| 268 | ;; * Starting with Emacs 30.1, use '(_ VALUEFORM)' instead of | 268 | ;; * Starting with Emacs 30.1, use '(_ VALUEFORM)' instead of |
| 269 | ;; '(VALUEFORM)' in 'if-let*/when-let*/and-let*'. | 269 | ;; '(VALUEFORM)' in 'if-let*/when-let*/and-let*'. |
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 59e4cea2edb..fa609ae6e15 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el | |||
| @@ -572,7 +572,7 @@ localname." | |||
| 572 | (setcar | 572 | (setcar |
| 573 | (cdr err) | 573 | (cdr err) |
| 574 | (replace-regexp-in-string encrypt-regexp filename (cadr err)))) | 574 | (replace-regexp-in-string encrypt-regexp filename (cadr err)))) |
| 575 | (signal (car err) (cdr err)))))) | 575 | (signal err))))) |
| 576 | 576 | ||
| 577 | (defun tramp-crypt-do-copy-or-rename-file | 577 | (defun tramp-crypt-do-copy-or-rename-file |
| 578 | (op filename newname &optional ok-if-already-exists keep-date | 578 | (op filename newname &optional ok-if-already-exists keep-date |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c83a7a9978d..e7e5a142b9d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -3468,9 +3468,10 @@ will be used." | |||
| 3468 | "Wrong method specification for `%s'" method))) | 3468 | "Wrong method specification for `%s'" method))) |
| 3469 | 3469 | ||
| 3470 | ;; Error handling. | 3470 | ;; Error handling. |
| 3471 | ;; FIXME: Use `unwind-protect'? | ||
| 3471 | ((error quit) | 3472 | ((error quit) |
| 3472 | (delete-file tmpfile) | 3473 | (delete-file tmpfile) |
| 3473 | (signal (car err) (cdr err))))) | 3474 | (signal err)))) |
| 3474 | 3475 | ||
| 3475 | ;; Impossible to copy. Trigger `file-missing' error. | 3476 | ;; Impossible to copy. Trigger `file-missing' error. |
| 3476 | (delete-file tmpfile) | 3477 | (delete-file tmpfile) |
| @@ -3526,10 +3527,11 @@ will be used." | |||
| 3526 | create-lockfiles) | 3527 | create-lockfiles) |
| 3527 | (condition-case err | 3528 | (condition-case err |
| 3528 | (write-region start end tmpfile append 'no-message) | 3529 | (write-region start end tmpfile append 'no-message) |
| 3530 | ;; FIXME: Use `unwind-protect'? | ||
| 3529 | ((error quit) | 3531 | ((error quit) |
| 3530 | (setq tramp-temp-buffer-file-name nil) | 3532 | (setq tramp-temp-buffer-file-name nil) |
| 3531 | (delete-file tmpfile) | 3533 | (delete-file tmpfile) |
| 3532 | (signal (car err) (cdr err))))) | 3534 | (signal err)))) |
| 3533 | 3535 | ||
| 3534 | ;; Now, `last-coding-system-used' has the right value. | 3536 | ;; Now, `last-coding-system-used' has the right value. |
| 3535 | ;; Remember it. | 3537 | ;; Remember it. |
| @@ -3567,10 +3569,10 @@ will be used." | |||
| 3567 | ;; We keep the local file for performance | 3569 | ;; We keep the local file for performance |
| 3568 | ;; reasons, useful for "rsync". | 3570 | ;; reasons, useful for "rsync". |
| 3569 | (copy-file tmpfile filename t) | 3571 | (copy-file tmpfile filename t) |
| 3570 | ((error quit) | 3572 | ((error quit) ;FIXME: `unwind-protect'? |
| 3571 | (setq tramp-temp-buffer-file-name nil) | 3573 | (setq tramp-temp-buffer-file-name nil) |
| 3572 | (delete-file tmpfile) | 3574 | (delete-file tmpfile) |
| 3573 | (signal (car err) (cdr err))))) | 3575 | (signal err)))) |
| 3574 | (setq tramp-temp-buffer-file-name nil) | 3576 | (setq tramp-temp-buffer-file-name nil) |
| 3575 | ;; Don't rename, in order to keep context in SELinux. | 3577 | ;; Don't rename, in order to keep context in SELinux. |
| 3576 | (unwind-protect | 3578 | (unwind-protect |
| @@ -5521,9 +5523,10 @@ connection if a previous connection has died for some reason." | |||
| 5521 | (tramp-set-connection-property p "connected" t)))) | 5523 | (tramp-set-connection-property p "connected" t)))) |
| 5522 | 5524 | ||
| 5523 | ;; Cleanup, and propagate the signal. | 5525 | ;; Cleanup, and propagate the signal. |
| 5526 | ;; FIXME: `unwind-protect'? | ||
| 5524 | ((error quit) | 5527 | ((error quit) |
| 5525 | (tramp-cleanup-connection vec t) | 5528 | (tramp-cleanup-connection vec t) |
| 5526 | (signal (car err) (cdr err))))))) | 5529 | (signal err)))))) |
| 5527 | 5530 | ||
| 5528 | (defun tramp-send-command (vec command &optional neveropen nooutput) | 5531 | (defun tramp-send-command (vec command &optional neveropen nooutput) |
| 5529 | "Send the COMMAND to connection VEC. | 5532 | "Send the COMMAND to connection VEC. |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 554aa354c00..8985f751bb1 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -610,11 +610,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 610 | (and (tramp-tramp-file-p filename) | 610 | (and (tramp-tramp-file-p filename) |
| 611 | (file-local-copy filename)))) | 611 | (file-local-copy filename)))) |
| 612 | ;; Remote filename. | 612 | ;; Remote filename. |
| 613 | (condition-case err | 613 | (unwind-protect |
| 614 | (rename-file tmpfile newname ok-if-already-exists) | 614 | (rename-file tmpfile newname ok-if-already-exists) |
| 615 | ((error quit) | 615 | (delete-file tmpfile)) |
| 616 | (delete-file tmpfile) | ||
| 617 | (signal (car err) (cdr err)))) | ||
| 618 | 616 | ||
| 619 | ;; Remote newname. | 617 | ;; Remote newname. |
| 620 | (when (and (file-directory-p newname) | 618 | (when (and (file-directory-p newname) |
| @@ -852,7 +850,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 852 | nil ;9 gid weird | 850 | nil ;9 gid weird |
| 853 | inode ;10 inode number | 851 | inode ;10 inode number |
| 854 | device)))) ;11 file system number | 852 | device)))) ;11 file system number |
| 855 | (remote-file-error (signal (car err) (cdr err))) | 853 | (remote-file-error (signal err)) |
| 856 | (error))))) | 854 | (error))))) |
| 857 | 855 | ||
| 858 | (defun tramp-smb-do-file-attributes-with-stat (vec) | 856 | (defun tramp-smb-do-file-attributes-with-stat (vec) |
| @@ -2125,7 +2123,7 @@ If ARGUMENT is non-nil, use it as argument for | |||
| 2125 | (tramp-cleanup-connection vec t) | 2123 | (tramp-cleanup-connection vec t) |
| 2126 | (tramp-smb-maybe-open-connection vec argument)) | 2124 | (tramp-smb-maybe-open-connection vec argument)) |
| 2127 | ;; Propagate the error. | 2125 | ;; Propagate the error. |
| 2128 | (signal (car err) (cdr err)))))))))))))) | 2126 | (signal err))))))))))))) |
| 2129 | 2127 | ||
| 2130 | ;; We don't use timeouts. If needed, the caller shall wrap around. | 2128 | ;; We don't use timeouts. If needed, the caller shall wrap around. |
| 2131 | (defun tramp-smb-wait-for-output (vec) | 2129 | (defun tramp-smb-wait-for-output (vec) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5441a26d7a0..fc607967194 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2153,7 +2153,7 @@ does not exist, otherwise propagate the error." | |||
| 2153 | (if (not (or (file-exists-p ,filename) (file-symlink-p ,filename))) | 2153 | (if (not (or (file-exists-p ,filename) (file-symlink-p ,filename))) |
| 2154 | (when (tramp-connectable-p ,vec) | 2154 | (when (tramp-connectable-p ,vec) |
| 2155 | (tramp-error ,vec 'file-missing ,filename)) | 2155 | (tramp-error ,vec 'file-missing ,filename)) |
| 2156 | (signal (car ,err) (cdr ,err))))))) | 2156 | (signal ,err)))))) |
| 2157 | 2157 | ||
| 2158 | (defun tramp-signal-hook-function (error-symbol data) | 2158 | (defun tramp-signal-hook-function (error-symbol data) |
| 2159 | "Function to be called via `signal-hook-function'. | 2159 | "Function to be called via `signal-hook-function'. |
| @@ -4038,7 +4038,7 @@ BODY is the backend specific code." | |||
| 4038 | (progn ,@body) | 4038 | (progn ,@body) |
| 4039 | (error (if tramp-inhibit-errors-if-setting-file-attributes-fail | 4039 | (error (if tramp-inhibit-errors-if-setting-file-attributes-fail |
| 4040 | (display-warning 'tramp (error-message-string err)) | 4040 | (display-warning 'tramp (error-message-string err)) |
| 4041 | (signal (car err) (cdr err))))))))) | 4041 | (signal err)))))))) |
| 4042 | 4042 | ||
| 4043 | (defmacro tramp-skeleton-write-region | 4043 | (defmacro tramp-skeleton-write-region |
| 4044 | (start end filename append visit lockname mustbenew &rest body) | 4044 | (start end filename append visit lockname mustbenew &rest body) |
| @@ -4846,9 +4846,9 @@ existing) are returned." | |||
| 4846 | (tramp-error v 'file-missing filename))) | 4846 | (tramp-error v 'file-missing filename))) |
| 4847 | (error | 4847 | (error |
| 4848 | (add-hook 'find-file-not-found-functions | 4848 | (add-hook 'find-file-not-found-functions |
| 4849 | `(lambda () (signal ',(car err) ',(cdr err))) | 4849 | (lambda () (signal err)) |
| 4850 | nil t) | 4850 | nil t) |
| 4851 | (signal (car err) (cdr err)))) | 4851 | (signal err))) |
| 4852 | 4852 | ||
| 4853 | ;; Save exit. | 4853 | ;; Save exit. |
| 4854 | (when visit | 4854 | (when visit |