source: project/release/4/condition-utils/trunk/standard-conditions.scm @ 29490

Last change on this file since 29490 was 29490, checked in by Kon Lovett, 7 years ago

save new conditions

File size: 3.0 KB
Line 
1;;;; standard-conditions.scm
2;;;; Kon Lovett, Jun '13
3
4(module standard-conditions
5
6  (;export
7    ;
8    exn-condition?
9    exn-location
10    exn-message
11    exn-arguments
12    exn-call-chain
13    ;
14    arity-condition?
15    type-condition?
16    arithmetic-condition?
17    i/o-condition?
18    file-condition?
19    network-condition?
20    network-timeout-condition?
21    bounds-condition?
22    runtime-condition?
23    runtime-limit-condition?
24    runtime-cycle-condition?
25    match-condition?
26    syntax-condition?
27    process-condition?
28    access-condition?
29    domain-condition?
30    memory-condition?
31  )
32
33  (import scheme chicken)
34
35  (use condition-utils)
36
37;;; Builtin Conditions
38
39; Signaled on errors.
40(define exn-condition? (condition-predicate* 'exn))
41
42(define exn-location (make-condition-property-accessor exn location))
43(define exn-message (make-condition-property-accessor exn message))
44(define exn-arguments (make-condition-property-accessor exn arguments))
45(define exn-call-chain (make-condition-property-accessor exn call-chain))
46
47; Signaled when a procedure is called with the wrong number of arguments.
48(define arity-condition? (make-condition-predicate exn arity))
49
50; Signaled on type-mismatch errors, for example when an argument of the wrong
51; type is passed to a built-in procedure.
52(define type-condition? (make-condition-predicate exn type))
53
54; Signaled on arithmetic errors, like division by zero.
55(define arithmetic-condition? (make-condition-predicate exn arithmetic))
56
57; Signaled on input/output errors.
58(define i/o-condition? (make-condition-predicate exn i/o))
59
60; Signaled on file-related errors.
61(define file-condition? (make-condition-predicate exn i/o file))
62
63; Signaled on network errors.
64(define network-condition? (make-condition-predicate exn i/o net))
65
66; Signaled on network timeout errors.
67(define network-timeout-condition? (make-condition-predicate exn i/o net timeout))
68
69; Signaled on errors caused by accessing non-existent elements of a collection.
70(define bounds-condition? (make-condition-predicate exn bounds))
71
72; Signaled on low-level runtime-system error-situations.
73(define runtime-condition? (make-condition-predicate exn runtime))
74
75; Signaled when an internal limit is exceeded (like running out of memory).
76(define runtime-limit-condition? (make-condition-predicate exn runtime limit))
77
78; Signaled when a graph cycle detected.
79(define runtime-cycle-condition? (make-condition-predicate exn runtime cycle))
80
81; Signaled on errors raised by failed matches (see the section on match).
82(define match-condition? (make-condition-predicate exn match))
83
84; Signaled on syntax errors.
85(define syntax-condition? (make-condition-predicate exn syntax))
86
87; Signaled on process errors.
88(define process-condition? (make-condition-predicate exn process))
89
90; Signaled on access errors.
91(define access-condition? (make-condition-predicate exn access))
92
93; Signaled on domain errors.
94(define domain-condition? (make-condition-predicate exn domain))
95
96; Signaled on memory errors.
97(define memory-condition? (make-condition-predicate exn memory))
98
99) ;standard-conditions
Note: See TracBrowser for help on using the repository browser.