* [PATCH] Add class name to eieio-oref error message
@ 2015-04-28 16:34 Przemysław Wojnowski
2015-05-01 17:12 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Przemysław Wojnowski @ 2015-04-28 16:34 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 210 bytes --]
Hello everybody,
A tiny patch to make error message more helpful to find offending code. It turns
message:
"eieio-oref called on a class!"
into:
"eieio-oref called on a class: my-class"
Cheers,
Przemysław
[-- Attachment #2: 0001-Add-class-name-to-error-message.patch --]
[-- Type: text/x-patch, Size: 1109 bytes --]
From 10d31a44136c565f49ecfefd097e127f0899236f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Przemys=C5=82aw=20Wojnowski?= <esperanto@cumego.com>
Date: Tue, 28 Apr 2015 18:13:18 +0200
Subject: [PATCH] ; Add class name to error message
* lisp/emacs-lisp/eieio-core.el (eieio-oref): Add class name to error
message to ease finding offending code.
---
lisp/emacs-lisp/eieio-core.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 92d7234..bf3f442 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -730,7 +730,7 @@ Argument FN is the function calling this verifier."
(cl-check-type slot symbol)
(cl-check-type obj (or eieio-object class))
(let* ((class (cond ((symbolp obj)
- (error "eieio-oref called on a class!")
+ (error "eieio-oref called on a class: %s" obj)
(let ((c (eieio--class-v obj)))
(if (eieio--class-p c) (eieio-class-un-autoload obj))
c))
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-01 17:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 16:34 [PATCH] Add class name to eieio-oref error message Przemysław Wojnowski
2015-05-01 17:12 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).