GNU bug report logs -
#28797
26.0.90; Improve printing of error on catching file-error in dired
Previous Next
Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Thu, 12 Oct 2017 14:57:02 UTC
Severity: minor
Tags: fixed, patch
Found in version 26.0.90
Fixed in version 26.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 28797 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
severity 28797 minor
tags 28797 + patch
quit
Kaushal Modi <kaushal.modi <at> gmail.com> writes:
> 1. Improving the format of error messages generated by catching error
> signals from C, so that the errors look almost like readable English
> instead of a dump of a list.
> 2. Those errors should generate a backtrace.. right now, a user needs
> to update the debug-on-message variable to force back traces for such
> messages which is, first: more cumbersome than doing M-x
> toggle-debug-on-error and then recreating the error, and second: not
> a common knowledge.
Here's a patch, uses error-message-string for #1,
condition-case-unless-debug for #2.
[v1-0001-Improve-dired-deletion-error-handling-Bug-28797.patch (text/x-diff, inline)]
From a150d99f8e278e9b90240e4b0c460ca974b32aeb Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Thu, 12 Oct 2017 23:12:00 -0400
Subject: [PATCH v1] Improve dired deletion error handling (Bug#28797)
* lisp/dired.el (dired-internal-do-deletions): Use
condition-case-unless-debug. Use `error-message-string' to produce a
human readable error message.
---
lisp/dired.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/dired.el b/lisp/dired.el
index 9e09d349f7..b24fea703a 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3132,7 +3132,7 @@ dired-internal-do-deletions
(while l
(goto-char (cdr (car l)))
(let ((inhibit-read-only t))
- (condition-case err
+ (condition-case-unless-debug err
(let ((fn (car (car l))))
(dired-delete-file fn dired-recursive-deletes trash)
;; if we get here, removing worked
@@ -3143,7 +3143,7 @@ dired-internal-do-deletions
#'dired-delete-entry fn))
(quit (throw '--delete-cancel (message "OK, canceled")))
(error ;; catch errors from failed deletions
- (dired-log "%s\n" err)
+ (dired-log "%s: %s\n" (car err) (error-message-string err))
(setq failures (cons (car (car l)) failures)))))
(setq l (cdr l)))
(if (not failures)
--
2.11.0
This bug report was last modified 7 years and 194 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.