diff options
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r-- | src/scm/webid-oidc/errors.scm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index 154f759..52cbbf1 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -37,6 +37,16 @@ (raise-exception ((record-constructor ¬-json) value cause))) +(define-public ¬-turtle + (make-exception-type + '¬-turtle + &external-error + '(value cause))) + +(define-public (raise-not-turtle value cause) + (raise-exception + ((record-constructor ¬-turtle) value cause))) + (define-public &unsupported-crv (make-exception-type '&unsupported-crv @@ -529,6 +539,16 @@ (raise-exception ((record-constructor &cannot-encode-dpop-proof) value cause))) +(define-public &cannot-fetch-linked-data + (make-exception-type + '&cannot-fetch-linked-data + &external-error + '(uri cause))) + +(define-public (raise-cannot-fetch-linked-data uri cause) + (raise-exception + ((record-constructor &cannot-fetch-linked-data) uri cause))) + (define*-public (error->str err #:key (max-depth #f)) (if (record? err) (let* ((type (record-type-descriptor err)) @@ -547,6 +567,9 @@ ((¬-json) (format #f (G_ "the value ~s is not JSON (because ~a)") (get 'value) (recurse (get 'cause)))) + ((¬-turtle) + (format #f (G_ "the value ~s is not Turtle (because ~a)") + (get 'value) (recurse (get 'cause)))) ((&unsupported-crv) (format #f (G_ "the value ~s does not identify an elleptic curve") (get 'crv))) @@ -761,6 +784,9 @@ ((&cannot-encode-dpop-proof) (format #f (G_ "I cannot encode ~s as a DPoP proof (because ~a)") (get 'value) (recurse (get 'cause)))) + ((&cannot-fetch-linked-data) + (format #f (G_ "I could not fetch a RDF graph at ~a (because ~a)") + (uri->string (get 'uri)) (recurse (get 'cause)))) ((&compound-exception) (let ((components (get 'components))) (if (null? components) |