summaryrefslogtreecommitdiff
path: root/src/scm/webid-oidc/errors.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r--src/scm/webid-oidc/errors.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm
index 959b04e..2dc9edc 100644
--- a/src/scm/webid-oidc/errors.scm
+++ b/src/scm/webid-oidc/errors.scm
@@ -37,6 +37,16 @@
(raise-exception
((record-constructor &not-json) value cause)))
+(define-public &not-turtle
+ (make-exception-type
+ '&not-turtle
+ &external-error
+ '(value cause)))
+
+(define-public (raise-not-turtle value cause)
+ (raise-exception
+ ((record-constructor &not-turtle) value cause)))
+
(define-public &unsupported-crv
(make-exception-type
'&unsupported-crv
@@ -529,6 +539,16 @@
(raise-exception
((record-constructor &cannot-encode-dpop-proof) dpop-proof key 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 @@
((&not-json)
(format #f (G_ "the value ~s is not JSON (because ~a)")
(get 'value) (recurse (get 'cause))))
+ ((&not-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)