[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Odd backtrace in condition-case
From: |
Lars Ingebrigtsen |
Subject: |
Odd backtrace in condition-case |
Date: |
Mon, 20 May 2019 19:26:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
I usually run with `debug-on-error' set, but lately I've started getting
these backtraces:
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
capitalize(nil)
timezone-make-arpa-date(2000 0 0 "01:00:00" (3600 "CET"))
timezone-make-date-arpa-standard("Session")
date-to-time("Session")
url-cookie-expired-p([url-cookie "NRK-Experiment-Bucket" "0" "Session" "/"
"www.nrk.no" nil])
[...]
url-http-create-request()
url-http-async-sentinel(#<process www.nrk.no> "open\n")
The code is:
(defun url-cookie-expired-p (cookie)
"Return non-nil if COOKIE is expired."
(let ((exp (url-cookie-expires cookie)))
(and (> (length exp) 0)
(condition-case ()
(time-less-p (date-to-time exp) nil)
(error nil)))))
My question is: Why does this give me a backtrace?
If I say something else, like:
(condition-case ()
(capitalize nil)
(error t))
=> t
I get no backtrace, but:
(condition-case ()
(date-to-time "Session")
(error t))
=>
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
capitalize(nil)
timezone-make-arpa-date(2000 0 0 "01:00:00" (3600 "CET"))
timezone-make-date-arpa-standard("Session")
date-to-time("Session")
(condition-case nil (date-to-time "Session") (error nil))
*scratches head*
Shouldn't the `error' clause in condition-case catch all errors?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Odd backtrace in condition-case,
Lars Ingebrigtsen <=