Basic development mostly done, need to do HTTP functionality now.
We might deprecate CLASH-SYS (both package and system) and incorporate that into the driver itself. For now we've removed all dependencies.
This commit is contained in:
42
src/main/conditions.cl
Normal file
42
src/main/conditions.cl
Normal file
@ -0,0 +1,42 @@
|
||||
;;;; CLASH --- The Common Lisp Adaptable Simple HTTP server
|
||||
;;;; This is copyrighted software. See documentation for terms.
|
||||
;;;;
|
||||
;;;; conditions.cl --- CLASH- and HTTP-specific conditions
|
||||
;;;;
|
||||
;;;; Checkout Tag: $Name$
|
||||
;;;; $Id$
|
||||
|
||||
(in-package :CLASH)
|
||||
|
||||
;;;; %File Description:
|
||||
;;;;
|
||||
;;;; This file defines a number of CLASH- and/or HTTP-specific
|
||||
;;;; conditions, which are used in the rest of CLASH for error
|
||||
;;;; signalling and handling.
|
||||
;;;;
|
||||
|
||||
(defun report-clash-error
|
||||
(condition stream &optional (fmt "Unspecified error.") args)
|
||||
(format stream
|
||||
"CLASH error: ~?~& Possible HTTP status code: ~D (~A)."
|
||||
fmt args
|
||||
(clash-error-code condition)
|
||||
(HTTP-code-description (clash-error-code condition))))
|
||||
|
||||
(define-condition clash-error (error)
|
||||
((code :initarg :code :initform +HTTP-Code-Internal-Server-Error+
|
||||
:type fixnum
|
||||
:reader clash-error-code
|
||||
#+NIL
|
||||
:documentation
|
||||
#+NIL
|
||||
"HTTP status code that might be returned to the client, if
|
||||
this makes sense."))
|
||||
(:report report-clash-error))
|
||||
|
||||
(define-condition simple-clash-error (simple-condition clash-error)
|
||||
()
|
||||
(:report (lambda (condition stream)
|
||||
(report-clash-error condition stream
|
||||
(simple-condition-format-control condition)
|
||||
(simple-condition-format-arguments condition)))))
|
||||
Reference in New Issue
Block a user