unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Odd backtrace in condition-case
@ 2019-05-20 17:26 Lars Ingebrigtsen
  2019-05-20 17:50 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-05-20 17:26 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-21 21:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20 17:26 Odd backtrace in condition-case Lars Ingebrigtsen
2019-05-20 17:50 ` Lars Ingebrigtsen
2019-05-20 18:22 ` Andy Moreton
2019-05-21 15:16   ` Paul Eggert
2019-05-21 21:51 ` 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).