-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_error.lisp
45 lines (29 loc) · 1.18 KB
/
http_error.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(in-package :user-comment-web-service)
(define-condition resource-not-found-error (error) ()
(:documentation "Raised when a request resource is not found.
When this error is handled, the response will have the 404 status
code.
This error can be raised in the following requests: GET, PATCH,
DELETE, POST."))
(define-condition request-data-missing (error) ()
(:documentation "Raised when a request body doesn't fulfill the
resource's schema.
For example, if a resource is the following:
(defclass foo (restful:resource)
((id :is-identifier t)
(name :required t))
(:metaclass restful:resource-metaclass))
And the request body is the following:
{\"id\":\"bar\"}
This error will be raised.
When this error is handled, the response will have a 400 status
code.
This error can be raised in the following requests: PUT, POST."))
(define-condition permission-rejected (error) ()
(:documentation "Raised when a request doesn't have access to the
requested resource.
This error is raised when the has-permission method of a resource
returns NIL.
When this error is handled, the response will have the 403 status
code.
This error can be raised with every method."))