[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select 5f36db7 167/218: Improve warning and e
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select 5f36db7 167/218: Improve warning and error messages |
Date: |
Fri, 14 Dec 2018 03:35:23 -0500 (EST) |
branch: feature/gnus-select
commit 5f36db72fe140a2f2c31e1d73ed64550584aed9b
Author: Eric Abrahamsen <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Improve warning and error messages
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read,
(eieio-persistent-validate/fix-slot-value): Indicate exactly what
went wrong.
---
lisp/emacs-lisp/eieio-base.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 3a78877..9f9f870 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -219,7 +219,7 @@ for CLASS. Optional ALLOW-SUBCLASS says that it is ok for
`eieio-persistent-read' to load in subclasses of class instead of
being pedantic."
(unless class
- (message "Unsafe call to `eieio-persistent-read'."))
+ (warn "`eieio-persistent-read' called without specifying a class"))
(when class (cl-check-type class class))
(let ((ret nil)
(buffstr nil))
@@ -234,13 +234,16 @@ being pedantic."
;; the current buffer will work.
(setq ret (read buffstr))
(when (not (child-of-class-p (car ret) 'eieio-persistent))
- (error "Corrupt object on disk: Unknown saved object"))
+ (error
+ "Invalid object: %s is not a subclass of `eieio-persistent'"
+ (car ret)))
(when (and class
- (not (or (eq (car ret) class ) ; same class
- (and allow-subclass
- (child-of-class-p (car ret) class)) ;
subclasses
- )))
- (error "Corrupt object on disk: Invalid saved class"))
+ (not (or (eq (car ret) class) ; same class
+ (and allow-subclass ; subclass
+ (child-of-class-p (car ret) class)))))
+ (error
+ "Invalid object: %s is not an object of class %s nor a subclass"
+ (car ret) class))
(setq ret (eieio-persistent-convert-list-to-object ret))
(oset ret file filename))
(kill-buffer " *tmp eieio read*"))
@@ -332,7 +335,8 @@ Second, any text properties will be stripped from strings."
;; We have a predicate, but it doesn't satisfy the predicate?
(dolist (PV (cdr proposed-value))
(unless (child-of-class-p (car PV) (car classtype))
- (error "Corrupt object on disk")))
+ (error "Invalid object: slot member %s does not match
class %s"
+ (car PV) (car classtype))))
;; We have a list of objects here. Lets load them
;; in.
- [Emacs-diffs] feature/gnus-select 7325e18 146/218: * cc-engine.el (c-looking-at-or-maybe-in-bracelist): Remove pessimization, (continued)
- [Emacs-diffs] feature/gnus-select 7325e18 146/218: * cc-engine.el (c-looking-at-or-maybe-in-bracelist): Remove pessimization, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select cbea6b1 145/218: Avoid redisplay problems with too wide wrap-prefix, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 3b5438f 148/218: Revert "Support all perl variable declarators and prefixes", Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e31b277 152/218: * lisp/play/fortune.el (fortune-in-buffer): Unadvertise no-op arg., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 246460c 155/218: Add tests for Bug#30408, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d219c99 143/218: Autoupdate from Gnulib, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b6d216c 169/218: Tag tramp-test39-utf8* as :unstable, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b74e19e 159/218: * lisp/play/fortune.el (fortune-in-buffer): Revert previous nonsense., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e3bcd11 160/218: Port data-tests-popcnt to 32-bit Emacs, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 19ed176 149/218: Improvements in dired.texi, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5f36db7 167/218: Improve warning and error messages,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 0bf81e2 174/218: ; Fix last commit in tramp.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 219d6cf 180/218: * doc/lispref/anti.texi (Antinews): Fix grammar., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7f60bfe 175/218: Port emacs-module-tests to 32-bit Emacs, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 9fabadf 179/218: Add new command vc-git-stash-delete, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 3ff0a07 182/218: Try and fix the more obvious sources of bug#30635, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4a80595 192/218: Fix too-large integer in Hg backend, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 992a8ec 187/218: * src/lisp.h (struct Lisp_Buffer_Local_Value): Update commentary., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 17a41a9 191/218: Avoid Fortran-style floating-point optimization, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 6eddea6 193/218: * src/process.c (Fsignal_process): Simplify., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 80ab319 204/218: Remove some unused gnus-registry variables, Andrew G Cohen, 2018/12/14