source: project/release/4/condition-utils/trunk/intarweb-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: 4.2 KB
Line 
1;;;; intarweb-conditions.scm
2;;;; Kon Lovett, Jun '13
3
4(module intarweb-conditions
5
6  (;export
7    ;
8    http-condition?
9    ;
10                urlencoded-request-data-limit-exceeded?
11                urlencoded-request-data-limit-exceeded-contents
12                urlencoded-request-data-limit-exceeded-limit
13    ;
14                line-limit-exceeded?
15                line-limit-exceeded-contents
16                line-limit-exceeded-limit
17    ;
18                header-error?
19                header-error-contents
20    ;
21                header-limit-exceeded?
22                header-limit-exceeded-contents
23                header-limit-exceeded-limit
24    ;
25                unknown-protocol-line?
26                unknown-protocol-line-line
27    ;
28                unknown-protocol?
29                unknown-protocol-major
30                unknown-protocol-minor
31    ;
32                unknown-code?
33                unknown-code-code
34    ;
35                unknown-status?
36                unknown-status-status
37    ;
38                rfc1123-subparser?
39                rfc1123-subparser-value?
40    ;
41                rfc850-subparser?
42                rfc850-subparser-value?
43    ;
44                asctime-subparser?
45                asctime-subparser-value?
46    ;
47                http-date-subparser?
48                http-date-subparser-value?
49    ;
50                unencoded-header?
51                unencoded-header-value?
52    ;
53                username-with-colon?
54                username-with-colon-value?
55  )
56
57  (import scheme chicken)
58
59  (use condition-utils)
60
61;;
62
63(define http-condition?
64  (make-condition-predicate exn http))
65
66;;
67
68(define urlencoded-request-data-limit-exceeded?
69        (make-condition-predicate exn http urlencoded-request-data-limit-exceeded))
70
71(define urlencoded-request-data-limit-exceeded-contents
72        (make-condition-property-accessor urlencoded-request-data-limit-exceeded contents))
73
74(define urlencoded-request-data-limit-exceeded-limit
75        (make-condition-property-accessor urlencoded-request-data-limit-exceeded limit))
76
77;;
78
79(define line-limit-exceeded?
80        (make-condition-predicate exn http line-limit-exceeded))
81
82(define line-limit-exceeded-contents
83        (make-condition-property-accessor line-limit-exceeded contents))
84
85(define line-limit-exceeded-limit
86        (make-condition-property-accessor line-limit-exceeded limit))
87
88;;
89
90(define header-error?
91        (make-condition-predicate exn http header-error))
92
93(define header-error-contents
94        (make-condition-property-accessor header-error contents))
95
96;;
97
98(define header-limit-exceeded?
99        (make-condition-predicate exn http header-limit-exceeded))
100
101(define header-limit-exceeded-contents
102        (make-condition-property-accessor header-limit-exceeded contents))
103
104(define header-limit-exceeded-limit
105        (make-condition-property-accessor header-limit-exceeded limit))
106
107;;
108
109(define unknown-protocol-line?
110        (make-condition-predicate exn http unknown-protocol-line))
111
112(define unknown-protocol-line-line
113        (make-condition-property-accessor unknown-protocol-line line))
114
115;;
116
117(define unknown-protocol?
118        (make-condition-predicate exn http unknown-protocol))
119
120(define unknown-protocol-major
121        (make-condition-property-accessor unknown-protocol major))
122
123(define unknown-protocol-minor
124        (make-condition-property-accessor unknown-protocol minor))
125
126;;
127
128(define unknown-code?
129        (make-condition-predicate exn http unknown-code))
130
131(define unknown-code-code
132        (make-condition-property-accessor unknown-code code))
133
134;;
135
136(define unknown-status?
137        (make-condition-predicate exn http unknown-status))
138
139(define unknown-status-status
140        (make-condition-property-accessor unknown-status status))
141
142;;
143
144(define rfc1123-subparser?
145        (make-condition-predicate exn http rfc1123-subparser))
146
147(define rfc1123-subparser-value?
148        (make-condition-property-accessor rfc1123-subparser value))
149
150;;
151
152(define rfc850-subparser?
153        (make-condition-predicate exn http rfc850-subparser))
154
155(define rfc850-subparser-value?
156        (make-condition-property-accessor rfc850-subparser value))
157
158;;
159
160(define asctime-subparser?
161        (make-condition-predicate exn http asctime-subparser))
162
163(define asctime-subparser-value?
164        (make-condition-property-accessor asctime-subparser value))
165
166;;
167
168(define http-date-subparser?
169        (make-condition-predicate exn http http-date-subparser))
170
171(define http-date-subparser-value?
172        (make-condition-property-accessor http-date-subparser value))
173
174;;
175
176(define unencoded-header?
177        (make-condition-predicate exn http unencoded-header))
178
179(define unencoded-header-value?
180        (make-condition-property-accessor unencoded-header value))
181
182;;
183
184(define username-with-colon?
185        (make-condition-predicate exn http username-with-colon))
186
187(define username-with-colon-value?
188        (make-condition-property-accessor username-with-colon value))
189
190
191) ;intarweb-conditions
Note: See TracBrowser for help on using the repository browser.