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.scm37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm
index 714e0be..4b4ba2d 100644
--- a/src/scm/webid-oidc/errors.scm
+++ b/src/scm/webid-oidc/errors.scm
@@ -788,6 +788,36 @@
((record-constructor &unknown-client-locale) web-locale c-locale)
#:continuable? #t))
+(define-public &unsupported-grant-type
+ (make-exception-type
+ '&unsupported-grant-type
+ &external-error
+ '(value)))
+
+(define-public (raise-unsupported-grant-type value)
+ (raise-exception
+ ((record-constructor &unsupported-grant-type) value)))
+
+(define-public &no-authorization-code
+ (make-exception-type
+ '&no-authorization-code
+ &external-error
+ '(value)))
+
+(define-public (raise-no-authorization-code)
+ (raise-exception
+ ((record-constructor &no-authorization-code))))
+
+(define-public &no-refresh-token
+ (make-exception-type
+ '&no-refresh-token
+ &external-error
+ '(value)))
+
+(define-public (raise-no-refresh-token)
+ (raise-exception
+ ((record-constructor &no-refresh-token))))
+
(define*-public (error->str err #:key (max-depth #f))
(if (record? err)
(let* ((type (record-type-descriptor err))
@@ -1089,6 +1119,13 @@
((&cannot-encode-id-token)
(format #f (G_ "I cannot encode ~s as an ID token (because ~a)")
(get 'value) (recurse (get 'cause))))
+ ((&unsupported-grant-type)
+ (format #f (G_ "the grant type ~s is not supported")
+ (get 'value)))
+ ((&no-authorization-code)
+ (format #f (G_ "there is no authorization code in the request")))
+ ((&no-refresh-token)
+ (format #f (G_ "there is no refresh token in the request")))
((&not-an-id-token)
(format #f (G_ "~s is not an ID token (because ~a)")
(get 'value) (recurse (get 'cause))))