diff options
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r-- | src/scm/webid-oidc/errors.scm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index c969a40..522e563 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -1036,6 +1036,22 @@ precondition-failed-if-none-match precondition-failed-real-etag) +(define-exception-type + ¬-acceptable + &external-error + make-not-acceptable + not-acceptable? + (client-accepts not-acceptable-client-accepts) + (path not-acceptable-path) + (content-type not-acceptable-content-type)) + +(export ¬-acceptable + make-not-acceptable + not-acceptable? + not-acceptable-client-accepts + not-acceptable-path + not-acceptable-content-type) + (define*-public (error->str err #:key (max-depth #f)) (if (record? err) (let* ((type (record-type-descriptor err)) @@ -1422,6 +1438,11 @@ (get 'path) (get 'if-match) (get 'if-none-match) (get 'real-etag)) (format #f (G_ "the client precondition failed for ~s: it allows for ~s, forbids ~s, but the resource has no representation") (get 'path) (get 'if-match) (get 'if-none-match)))) + ((¬-acceptable) + (format #f (G_ "the client wanted a response with a content type among ~s, but the resource at ~s has content-type ~s which cannot be converted to one of them") + (get 'client-accepts) + (get 'path) + (get 'content-type))) ((&compound-exception) (let ((components (get 'components))) (if (null? components) |