Skip to content

Commit

Permalink
✨ feat(errors): Ajout de la gestion des erreurs 520 et 521
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot committed Nov 4, 2022
1 parent cefc6ad commit 095296d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/js/components/EcoIndexDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const ERROR_MESSAGES = {
`,
504: `
{{- i18n "Error504" | markdownify -}}
`,
520: `
{{- i18n "Error520" | markdownify -}}
`,
521: `
{{- i18n "Error521" | markdownify -}}
`,
};

Expand Down Expand Up @@ -47,8 +53,8 @@ class EcoIndexDialog {

// prettier-ignore
a11yDialog
.on("show", () => (html.style.overflowY = "hidden"))
.on("hide", () => (html.style.overflowY = ""));
.on("show", () => (html.style.overflowY = "hidden"))
.on("hide", () => (html.style.overflowY = ""));

return this;
}
Expand Down
4 changes: 4 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ More information on page [How it works](/how-it-works/)."""
other = "The URL you provided is not valid. Please check the URL and try again."
[Error504]
other = "The page you want to test does not respond. Please try again later."
[Error520]
other = "This resource you want to test is not a standard HTML page with mimeType 'text/html'"
[Error521]
other = "The page you want to test can not be analyzed because its response status code is not 200"
[BetaMessage]
other = "This site is in **beta** version. Feel free to give us feedback on [Github discussions](https://github.com/cnumr/EcoIndex/discussions/)"
[NoJSMessage]
Expand Down
4 changes: 4 additions & 0 deletions i18n/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Pour en savoir plus, veuiller consulter la page [Comment ça marche ?](/commen
other = "L’url demandée n’est pas valide. Veuillez vérifier l’URL et réessayer."
[Error504]
other = "La page web indiquée ne semble pas répondre. Pouvez vous réessayer plus tard ?"
[Error520]
other = "La ressource que vous essayez d'analyser n'est pas une page HTML standard avec un mimetype 'text/html'"
[Error521]
other = "La page que vous essayez de tester ne peut pas être analysée car elle est en erreur (son code réponse n'est pas 200)"
[BetaMessage]
other = "Ce site est en version **beta**. N’hésitez pas à nous faire part de vos commentaires sur [les discussions Github](https://github.com/cnumr/EcoIndex/discussions/)"
[NoJSMessage]
Expand Down

0 comments on commit 095296d

Please sign in to comment.