1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
3 ;;; --- Error conditions.
6 (in-package :iolib.base
)
8 ;;;-------------------------------------------------------------------------
10 ;;;-------------------------------------------------------------------------
12 (define-condition subtype-error
(error)
13 ((datum :initarg
:type
:reader subtype-error-datum
)
14 (expected-supertype :initarg
:expected-supertype
15 :reader subtype-error-expected-supertype
))
17 (lambda (condition stream
)
18 (format stream
"~S is not a recognizable subtype of ~S"
19 (subtype-error-datum condition
)
20 (subtype-error-expected-supertype condition
)))))
23 ;;;-------------------------------------------------------------------------
24 ;;; Literal Syntax Errors
25 ;;;-------------------------------------------------------------------------
27 (define-condition unknown-literal-syntax
(reader-error)
28 ((name :initarg
:name
:reader unknown-literal-syntax-name
))
29 (:report
(lambda (condition stream
)
30 (format stream
"Unknown literal read syntax: ~S"
31 (unknown-literal-syntax-name condition
)))))
34 ;;;-------------------------------------------------------------------------
36 ;;;-------------------------------------------------------------------------
38 (define-condition iolib-bug
(error)
39 ((message :initarg
:message
:reader iolib-bug-message
))
41 (lambda (condition stream
)
42 (format stream
"~A.~%This seems to be a bug in IOlib. ~
43 Please report it to iolib-devel@common-lisp.net"
44 (iolib-bug-message condition
)))))
46 (defun bug (control &rest args
)
47 (error 'iolib-bug
:message
(format nil
"~?" control args
)))