diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-08-15 17:31:48 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-09-13 19:26:45 +0200 |
commit | 44d80f685c01887f4b804de670dd59b7dd3a7c5e (patch) | |
tree | f9b651f77308ad50fd72c0b3c79315d3b941fd35 | |
parent | e2b2b0654427d0a575a0c49ac69db07d5674417b (diff) |
Fix exceptions
-rw-r--r-- | po/disfluid.pot | 65 | ||||
-rw-r--r-- | po/fr.po | 67 | ||||
-rw-r--r-- | src/scm/webid-oidc/jwk.scm | 21 |
3 files changed, 103 insertions, 50 deletions
diff --git a/po/disfluid.pot b/po/disfluid.pot index 86027da..516f538 100644 --- a/po/disfluid.pot +++ b/po/disfluid.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: disfluid SNAPSHOT\n" "Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n" -"POT-Creation-Date: 2021-08-13 01:10+0200\n" +"POT-Creation-Date: 2021-09-13 19:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -293,8 +293,8 @@ msgid "cannot encode the authorization code" msgstr "" #: src/scm/webid-oidc/authorization-page-unsafe.scm:52 -#: src/scm/webid-oidc/hello-world.scm:40 src/scm/webid-oidc/hello-world.scm:169 -#: src/scm/webid-oidc/hello-world.scm:189 +#: src/scm/webid-oidc/hello-world.scm:40 src/scm/webid-oidc/hello-world.scm:167 +#: src/scm/webid-oidc/hello-world.scm:187 #: src/scm/webid-oidc/identity-provider.scm:139 #: src/scm/webid-oidc/token-endpoint.scm:111 #: src/scm/webid-oidc/token-endpoint.scm:137 @@ -731,40 +731,40 @@ msgstr "" msgid "cannot negociate a recognized RFD content type, got ~s" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:46 +#: src/scm/webid-oidc/hello-world.scm:44 #, scheme-format msgid "<h1>Hello, ~a!</h1>" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:56 +#: src/scm/webid-oidc/hello-world.scm:54 msgid "<p>The client is compatible with Solid.</p>" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:66 src/scm/webid-oidc/program.scm:225 +#: src/scm/webid-oidc/hello-world.scm:64 src/scm/webid-oidc/program.scm:225 msgid "command-line|version" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:68 src/scm/webid-oidc/program.scm:229 +#: src/scm/webid-oidc/hello-world.scm:66 src/scm/webid-oidc/program.scm:229 msgid "command-line|complete-corresponding-source" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:70 src/scm/webid-oidc/program.scm:231 +#: src/scm/webid-oidc/hello-world.scm:68 src/scm/webid-oidc/program.scm:231 msgid "command-line|help" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:72 +#: src/scm/webid-oidc/hello-world.scm:70 msgid "command-line|port" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:74 src/scm/webid-oidc/program.scm:263 +#: src/scm/webid-oidc/hello-world.scm:72 src/scm/webid-oidc/program.scm:263 msgid "command-line|log-file" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:76 src/scm/webid-oidc/program.scm:265 +#: src/scm/webid-oidc/hello-world.scm:74 src/scm/webid-oidc/program.scm:265 msgid "command-line|error-file" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:88 +#: src/scm/webid-oidc/hello-world.scm:86 #, scheme-format msgid "" "~a [OPTIONS]...\n" @@ -793,43 +793,43 @@ msgid "" " redirect the program errors to FILE.err.\n" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:121 +#: src/scm/webid-oidc/hello-world.scm:119 #, scheme-format msgid "~a version ~a\n" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:130 src/scm/webid-oidc/program.scm:624 +#: src/scm/webid-oidc/hello-world.scm:128 src/scm/webid-oidc/program.scm:624 msgid "" "You are legally required to link to the complete corresponding source code.\n" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:140 +#: src/scm/webid-oidc/hello-world.scm:138 msgid "The port should be a number between 0 and 65535.\n" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:161 +#: src/scm/webid-oidc/hello-world.scm:159 #: src/scm/webid-oidc/resource-server.scm:320 msgid "reason-phrase|Unauthorized" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:173 +#: src/scm/webid-oidc/hello-world.scm:171 msgid "<h1>Please authenticate</h1>" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:177 +#: src/scm/webid-oidc/hello-world.scm:175 msgid "<p>This page requires authentication with Solid.</p>" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:181 +#: src/scm/webid-oidc/hello-world.scm:179 #: src/scm/webid-oidc/resource-server.scm:328 msgid "reason-phrase|Method Not Allowed" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:193 +#: src/scm/webid-oidc/hello-world.scm:191 msgid "<h1>Method not allowed</h1>" msgstr "" -#: src/scm/webid-oidc/hello-world.scm:197 +#: src/scm/webid-oidc/hello-world.scm:195 msgid "<p>You can only use the <emph>GET</emph> method on this resource.</p>" msgstr "" @@ -891,6 +891,29 @@ msgstr "" msgid "the JWKS is invalid" msgstr "" +#: src/scm/webid-oidc/jwk.scm:235 +#, scheme-format +msgid "cannot fetch a JWKS: ~a" +msgstr "" + +#: src/scm/webid-oidc/jwk.scm:237 +msgid "cannot fetch a JWKS" +msgstr "" + +#: src/scm/webid-oidc/jwk.scm:241 +#, scheme-format +msgid "the request failed with ~s ~s" +msgstr "" + +#: src/scm/webid-oidc/jwk.scm:246 +msgid "missing content-type" +msgstr "" + +#: src/scm/webid-oidc/jwk.scm:251 +#, scheme-format +msgid "invalid content-type: ~s" +msgstr "" + #: src/scm/webid-oidc/jws.scm:72 #, scheme-format msgid "the JWS is invalid: ~a" @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: webid-oidc 0.0.0\n" "Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n" -"POT-Creation-Date: 2021-08-13 01:10+0200\n" -"PO-Revision-Date: 2021-08-13 01:11+0200\n" +"POT-Creation-Date: 2021-09-13 19:24+0200\n" +"PO-Revision-Date: 2021-09-13 19:25+0200\n" "Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n" "Language-Team: French <vivien@planete-kraus.eu>\n" "Language: fr\n" @@ -304,8 +304,8 @@ msgid "cannot encode the authorization code" msgstr "impossible d’encoder le code d’autorisation" #: src/scm/webid-oidc/authorization-page-unsafe.scm:52 -#: src/scm/webid-oidc/hello-world.scm:40 src/scm/webid-oidc/hello-world.scm:169 -#: src/scm/webid-oidc/hello-world.scm:189 +#: src/scm/webid-oidc/hello-world.scm:40 src/scm/webid-oidc/hello-world.scm:167 +#: src/scm/webid-oidc/hello-world.scm:187 #: src/scm/webid-oidc/identity-provider.scm:139 #: src/scm/webid-oidc/token-endpoint.scm:111 #: src/scm/webid-oidc/token-endpoint.scm:137 @@ -766,40 +766,40 @@ msgstr "la requête a échoué de façon inattendue avec ~s ~s" msgid "cannot negociate a recognized RFD content type, got ~s" msgstr "impossible de négocier un type de contenu RDF reconnu, ayant obtenu ~s" -#: src/scm/webid-oidc/hello-world.scm:46 +#: src/scm/webid-oidc/hello-world.scm:44 #, scheme-format msgid "<h1>Hello, ~a!</h1>" msgstr "<h1>Bonjour, ~a !</h1>" -#: src/scm/webid-oidc/hello-world.scm:56 +#: src/scm/webid-oidc/hello-world.scm:54 msgid "<p>The client is compatible with Solid.</p>" msgstr "<p>Le client est compatible avec Solid.</p>" -#: src/scm/webid-oidc/hello-world.scm:66 src/scm/webid-oidc/program.scm:225 +#: src/scm/webid-oidc/hello-world.scm:64 src/scm/webid-oidc/program.scm:225 msgid "command-line|version" msgstr "version" -#: src/scm/webid-oidc/hello-world.scm:68 src/scm/webid-oidc/program.scm:229 +#: src/scm/webid-oidc/hello-world.scm:66 src/scm/webid-oidc/program.scm:229 msgid "command-line|complete-corresponding-source" msgstr "code-source-correspondant-complet" -#: src/scm/webid-oidc/hello-world.scm:70 src/scm/webid-oidc/program.scm:231 +#: src/scm/webid-oidc/hello-world.scm:68 src/scm/webid-oidc/program.scm:231 msgid "command-line|help" msgstr "aide" -#: src/scm/webid-oidc/hello-world.scm:72 +#: src/scm/webid-oidc/hello-world.scm:70 msgid "command-line|port" msgstr "port" -#: src/scm/webid-oidc/hello-world.scm:74 src/scm/webid-oidc/program.scm:263 +#: src/scm/webid-oidc/hello-world.scm:72 src/scm/webid-oidc/program.scm:263 msgid "command-line|log-file" msgstr "fichier-journal" -#: src/scm/webid-oidc/hello-world.scm:76 src/scm/webid-oidc/program.scm:265 +#: src/scm/webid-oidc/hello-world.scm:74 src/scm/webid-oidc/program.scm:265 msgid "command-line|error-file" msgstr "fichier-erreur" -#: src/scm/webid-oidc/hello-world.scm:88 +#: src/scm/webid-oidc/hello-world.scm:86 #, scheme-format msgid "" "~a [OPTIONS]...\n" @@ -853,45 +853,45 @@ msgstr "" " -e FICHIER.err, --~a=FICHIER.err :\n" " redirige la sortie d’erreur du programme vers ce fichier.\n" -#: src/scm/webid-oidc/hello-world.scm:121 +#: src/scm/webid-oidc/hello-world.scm:119 #, scheme-format msgid "~a version ~a\n" msgstr "~a version ~a\n" -#: src/scm/webid-oidc/hello-world.scm:130 src/scm/webid-oidc/program.scm:624 +#: src/scm/webid-oidc/hello-world.scm:128 src/scm/webid-oidc/program.scm:624 msgid "" "You are legally required to link to the complete corresponding source code.\n" msgstr "" "Vous êtes légalement tenu de fournir un lien vers le code source " "correspondant.\n" -#: src/scm/webid-oidc/hello-world.scm:140 +#: src/scm/webid-oidc/hello-world.scm:138 msgid "The port should be a number between 0 and 65535.\n" msgstr "Le port doit être un nombre entre 0 et 65535.\n" -#: src/scm/webid-oidc/hello-world.scm:161 +#: src/scm/webid-oidc/hello-world.scm:159 #: src/scm/webid-oidc/resource-server.scm:320 msgid "reason-phrase|Unauthorized" msgstr "Non Autorisé" -#: src/scm/webid-oidc/hello-world.scm:173 +#: src/scm/webid-oidc/hello-world.scm:171 msgid "<h1>Please authenticate</h1>" msgstr "<h1>Veuillez vous authentifier</h1>" -#: src/scm/webid-oidc/hello-world.scm:177 +#: src/scm/webid-oidc/hello-world.scm:175 msgid "<p>This page requires authentication with Solid.</p>" msgstr "<p>Cette page requiert une authentification avec Solid.</p>" -#: src/scm/webid-oidc/hello-world.scm:181 +#: src/scm/webid-oidc/hello-world.scm:179 #: src/scm/webid-oidc/resource-server.scm:328 msgid "reason-phrase|Method Not Allowed" msgstr "Méthode Non Autorisée" -#: src/scm/webid-oidc/hello-world.scm:193 +#: src/scm/webid-oidc/hello-world.scm:191 msgid "<h1>Method not allowed</h1>" msgstr "<h1>Méthode non autorisée</h1>" -#: src/scm/webid-oidc/hello-world.scm:197 +#: src/scm/webid-oidc/hello-world.scm:195 msgid "<p>You can only use the <emph>GET</emph> method on this resource.</p>" msgstr "" "<p>Vous pouvez uniquement utiliser la méthode <emph>GET</emph> pour cette " @@ -955,6 +955,29 @@ msgstr "le JWKS est invalide : ~a" msgid "the JWKS is invalid" msgstr "le JWKS est invalide" +#: src/scm/webid-oidc/jwk.scm:235 +#, scheme-format +msgid "cannot fetch a JWKS: ~a" +msgstr "Impossible de télécharger un JWKS : ~a" + +#: src/scm/webid-oidc/jwk.scm:237 +msgid "cannot fetch a JWKS" +msgstr "impossible de décoder un JWKS" + +#: src/scm/webid-oidc/jwk.scm:241 +#, scheme-format +msgid "the request failed with ~s ~s" +msgstr "la requête a échoué avec ~s ~s" + +#: src/scm/webid-oidc/jwk.scm:246 +msgid "missing content-type" +msgstr "type de contenu manquant" + +#: src/scm/webid-oidc/jwk.scm:251 +#, scheme-format +msgid "invalid content-type: ~s" +msgstr "type de contenu invalide : ~s" + #: src/scm/webid-oidc/jws.scm:72 #, scheme-format msgid "the JWS is invalid: ~a" diff --git a/src/scm/webid-oidc/jwk.scm b/src/scm/webid-oidc/jwk.scm index 5b17f29..9c1425a 100644 --- a/src/scm/webid-oidc/jwk.scm +++ b/src/scm/webid-oidc/jwk.scm @@ -227,21 +227,28 @@ (define* (get-jwks uri #:key (http-get http-get)) (receive (response response-body) (http-get uri) (with-exception-handler - (lambda (cause) - (raise-unexpected-response response cause)) + (lambda (error) + (raise-exception + (make-not-a-jwks) + (make-exception-with-message + (if (exception-with-message? error) + (format #f (G_ "cannot fetch a JWKS: ~a") + (exception-message error)) + (format #f (G_ "cannot fetch a JWKS")))) + error)) (lambda () (unless (eqv? (response-code response) 200) - (raise-request-failed-unexpectedly - (response-code response) - (response-reason-phrase response))) + (fail (format #f (G_ "the request failed with ~s ~s") + (response-code response) + (response-reason-phrase response)))) (let ((content-type (response-content-type response))) (unless content-type - (raise-unexpected-header-value 'content-type content-type)) + (fail (format #f (G_ "missing content-type")))) (unless (and (eq? (car content-type) 'application/json) (or (equal? (assoc-ref (cdr content-type) 'charset) "utf-8") (not (assoc-ref (cdr content-type) 'charset)))) - (raise-unexpected-header-value 'content-type content-type)) + (fail (format #f (G_ "invalid content-type: ~s") content-type))) (unless (string? response-body) (set! response-body (utf8->string response-body))) (the-jwks (stubs:json-string->scm response-body))))))) |