ALLOCATE-ENV: the number of elements is HASH-TABLE-COUNT not HASH-TABLE-SIZE
[iolib.git] / src / base / conditions.lisp
blob22f68f9df79e831f5253cb4d22f72b3228c3a625
1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Error conditions.
4 ;;;
6 (in-package :iolib.base)
8 ;;;-------------------------------------------------------------------------
9 ;;; Subtype Errors
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))
16 (:report
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 ;;;-------------------------------------------------------------------------
35 ;;; Bugs
36 ;;;-------------------------------------------------------------------------
38 (define-condition iolib-bug (error)
39 ((message :initarg :message :reader iolib-bug-message))
40 (:report
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)))