diff options
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r-- | src/scm/webid-oidc/errors.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index 80a4f37..5f07644 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -1002,6 +1002,24 @@ forbidden-owner forbidden-mode) +(define-exception-type + &precondition-failed + &external-error + make-precondition-failed + precondition-failed? + (path precondition-failed-path) + (if-match precondition-failed-if-match) + (if-none-match precondition-failed-if-none-match) + (real-etag precondition-failed-real-etag)) + +(export &precondition-failed + make-precondition-failed + precondition-failed? + precondition-failed-path + precondition-failed-if-match + precondition-failed-if-none-match + precondition-failed-real-etag) + (define*-public (error->str err #:key (max-depth #f)) (if (record? err) (let* ((type (record-type-descriptor err)) @@ -1378,6 +1396,12 @@ (format #f (G_ "the operation on ~s by ~s is refused, because it’s not by ~s and the access control forbids the following mode of operation: ~s") (get 'path) (uri->string (get 'user)) (uri->string (get 'owner)) (uri->string (get 'mode)))) + ((&precondition-failed) + (if (get 'real-etag) + (format #f (G_ "the client precondition failed for ~s: it allows for ~s, forbids ~s, but the resource has a representation of ~s") + (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)))) ((&compound-exception) (let ((components (get 'components))) (if (null? components) |