Add function FILE-PATH.
[iolib.git] / base / conditions.lisp
blob595989e39b97c5995d74fbce4f81b2a501370d95
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Error conditions.
4 ;;;
6 (in-package :iolib.base)
8 (define-condition subtype-error (error)
9 ((datum :initarg :type :reader subtype-error-datum)
10 (expected-supertype :initarg :expected-supertype
11 :reader subtype-error-expected-supertype))
12 (:report
13 (lambda (condition stream)
14 (format stream "~S is not a recognizable subtype of ~S"
15 (subtype-error-datum condition)
16 (subtype-error-expected-supertype condition)))))
19 ;;;-------------------------------------------------------------------------
20 ;;; Bugs
21 ;;;-------------------------------------------------------------------------
23 (define-condition iolib-bug (error)
24 ((message :initarg :message :reader iolib-bug-message))
25 (:report
26 (lambda (condition stream)
27 (format stream "~A.~%This seems to be a bug in IOlib. ~
28 Please report it to iolib-devel@common-lisp.net"
29 (iolib-bug-message condition)))))
31 (defun bug (control &rest args)
32 (error 'iolib-bug :message (format nil "~?" control args)))