-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconditions.lisp
29 lines (26 loc) · 968 Bytes
/
conditions.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;;;; SPDX-FileCopyrightText: Atlas Engineer LCC
;;;; SPDX-License-Identifier: BSD-3-Clause
(in-package #:readability)
(define-condition too-many-elements-error (error)
((possible-maximum
:initform *max-elements*
:accessor possible-maximum
:initarg :possible-maximum)
(number-of-elements
:initform nil
:accessor number-of-elements
:initarg :number-of-elements))
(:report
(lambda (condition stream)
(format stream
"Too many elements in the document: found ~d, expected no more than ~d"
(number-of-elements condition) (possible-maximum condition))))
(:documentation "A condition to signal when the number of elements to parse is too large.
See `*max-elements*'."))
(define-condition no-attributes-error (error)
((node
:accessor node
:initarg :node))
(:report
(lambda (condition stream)
(format stream "Tried to get attributes of ~a, but it has no attributes." (node condition)))))