[version 0.14.6 ediware**20071109060017] { hunk ./CHANGELOG 1 +Version 0.14.6 +2007-11.08 +Fix compilation order (thanks to Tiarnan O'Corrain and Chris Dean) + addfile ./conditions.lisp hunk ./conditions.lisp 1 +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: HUNCHENTOOT; Base: 10 -*- +;;; $Header: /usr/local/cvsrep/hunchentoot/conditions.lisp,v 1.1 2007/11/08 20:07:58 edi Exp $ + +;;; Copyright (c) 2004-2007, Dr. Edmund Weitz. All rights reserved. + +;;; Redistribution and use in source and binary forms, with or without +;;; modification, are permitted provided that the following conditions +;;; are met: + +;;; * Redistributions of source code must retain the above copyright +;;; notice, this list of conditions and the following disclaimer. + +;;; * Redistributions in binary form must reproduce the above +;;; copyright notice, this list of conditions and the following +;;; disclaimer in the documentation and/or other materials +;;; provided with the distribution. + +;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED +;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(in-package :hunchentoot) + +(defvar *catch-errors-p* t + "Whether Hunchentoot should catch and log errors \(or rather +invoke the debugger).") + +(defgeneric maybe-invoke-debugger (condition) + (:documentation "This generic function is called whenever a +condition CONDITION is signaled in Hunchentoot. You might want to +specialize it on specific condition classes for debugging purposes.") + (:method (condition) + "The default method invokes the debugger with CONDITION if +*CATCH-ERRORS-P* is NIL." + (unless *catch-errors-p* + (invoke-debugger condition)))) + +(defmacro with-debugger (&body body) + "Executes BODY and invokes the debugger if an error is signaled and +*CATCH-ERRORS-P* is NIL." + `(handler-bind ((error #'maybe-invoke-debugger)) + ,@body)) + +(defmacro ignore-errors (&body body) + "Like CL:IGNORE-ERRORS, but observes *CATCH-ERRORS-P*." + `(cl:ignore-errors (with-debugger ,@body))) + +(defmacro handler-case (expression &rest clauses) + "Like CL:HANDLER-CASE, but observes *CATCH-ERRORS-P*." + `(cl:handler-case (with-debugger ,expression) + ,@clauses)) + hunk ./doc/index.html 83 -Jalat, Heike Stephan, Makewavs, ERGO, and the NIST. +Jalat, Heike Stephan, +xOs, +and the NIST. hunk ./doc/index.html 144 -current version is 0.14.5. There's also a port +current version is 0.14.6. There's also a port hunk ./doc/index.html 2609 -$Header: /usr/local/cvsrep/hunchentoot/doc/index.html,v 1.117 2007/11/03 21:46:21 edi Exp $ +$Header: /usr/local/cvsrep/hunchentoot/doc/index.html,v 1.120 2007/11/08 20:08:00 edi Exp $ hunk ./hunchentoot.asd 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/hunchentoot.asd,v 1.50 2007/11/03 21:46:18 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/hunchentoot.asd,v 1.51 2007/11/08 20:07:58 edi Exp $ hunk ./hunchentoot.asd 37 -(defvar *hunchentoot-version* "0.14.5" +(defvar *hunchentoot-version* "0.14.6" hunk ./hunchentoot.asd 57 + (:file "conditions") hunk ./specials.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/specials.lisp,v 1.30 2007/09/14 12:12:33 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/specials.lisp,v 1.31 2007/11/08 20:07:58 edi Exp $ hunk ./specials.lisp 184 - -(defvar *catch-errors-p* t - "Whether Hunchentoot should catch and log errors \(or rather -invoke the debugger).") hunk ./util.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/util.lisp,v 1.31 2007/06/04 19:20:22 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/util.lisp,v 1.32 2007/11/08 20:07:58 edi Exp $ hunk ./util.lisp 102 - -(defgeneric maybe-invoke-debugger (condition) - (:documentation "This generic function is called whenever a -condition CONDITION is signaled in Hunchentoot. You might want to -specialize it on specific condition classes for debugging purposes.") - (:method (condition) - "The default method invokes the debugger with CONDITION if -*CATCH-ERRORS-P* is NIL." - (unless *catch-errors-p* - (invoke-debugger condition)))) - -(defmacro with-debugger (&body body) - "Executes BODY and invokes the debugger if an error is signaled and -*CATCH-ERRORS-P* is NIL." - `(handler-bind ((error #'maybe-invoke-debugger)) - ,@body)) - -(defmacro ignore-errors (&body body) - "Like CL:IGNORE-ERRORS, but observes *CATCH-ERRORS-P*." - `(cl:ignore-errors (with-debugger ,@body))) - -(defmacro handler-case (expression &rest clauses) - "Like CL:HANDLER-CASE, but observes *CATCH-ERRORS-P*." - `(cl:handler-case (with-debugger ,expression) - ,@clauses)) }