summaryrefslogtreecommitdiff
path: root/src/scm/webid-oidc/errors.scm
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2020-11-29 19:21:28 +0100
committerVivien Kraus <vivien@planete-kraus.eu>2021-06-19 15:44:36 +0200
commite276d3d60270f5af9e606e8c3afcc365ab7aeacd (patch)
tree95b60d0a96e27f8fbd341cdb112e3ef52d60e81e /src/scm/webid-oidc/errors.scm
parente74c0727183e310c479a1d45a472bdef68db9a04 (diff)
Get an openid configuration on the web
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r--src/scm/webid-oidc/errors.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm
index 1476e86..beeaaea 100644
--- a/src/scm/webid-oidc/errors.scm
+++ b/src/scm/webid-oidc/errors.scm
@@ -217,6 +217,16 @@
(raise-exception
((record-constructor &unexpected-response) response cause)))
+(define-public &not-an-oidc-configuration
+ (make-exception-type
+ '&not-an-oidc-configuration
+ &external-error
+ '(value cause)))
+
+(define-public (raise-not-an-oidc-configuration value cause)
+ (raise-exception
+ ((record-constructor &not-an-oidc-configuration) value cause)))
+
(define*-public (error->str err #:key (max-depth #f))
(if (record? err)
(let* ((type (record-type-descriptor err))
@@ -309,6 +319,9 @@
(lambda (port)
(write-response (get 'response) port)))
(recurse (get 'cause))))
+ ((&not-an-oidc-configuration)
+ (format #f (G_ "the value ~s is not an OIDC configuration (because ~a)")
+ (get 'value) (recurse (get 'cause))))
((&compound-exception)
(let ((components (get 'components)))
(if (null? components)