🎉 Add clear error messages (#9886)

This commit is contained in:
Eva Marco 2026-05-29 13:27:43 +02:00 committed by GitHub
parent 237fa568e8
commit 6e8d2b3708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 1 deletions

View File

@ -496,7 +496,22 @@
[:div (:name entry)]
(when-let [err (:error entry)]
[:div {:class (stl/css :import-error-detail)}
(tr err)])]))]
;; Temporary frontend-side error translations to provide more meaningful
;; messages until backend error handling is improved and standardized.
;; These mappings are only a short-term workaround and should be removed
;; once the error handling enhancement is implemented.
;; https://github.com/penpot/penpot/issues/9884
(cond
(and (string? err)
(str/includes? (str/lower err) "check error"))
(tr "dashboard.import.import-error.check-error")
(and (string? err)
(str/includes? (str/lower err) "corrupt"))
(tr "dashboard.import.import-error.corrupt-file")
:else
(tr "dashboard.import.import-error.unknown-error"))])]))]
[:div (tr "dashboard.import.import-error.message2")]]
(for [entry entries]

View File

@ -755,6 +755,18 @@ msgstr "Uploading data to server (%s/%s)"
msgid "dashboard.import.progress.upload-media"
msgstr "Uploading file: %s"
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.check-error"
msgstr "We couldn't verify this file."
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.corrupt-file"
msgstr "This file appears to be damaged."
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.unknown-error"
msgstr "Something went wrong while processing this file."
#: src/app/main/ui/dashboard/team.cljs:765
msgid "dashboard.invitation-modal.delete"
msgstr "You're going to delete the invitations to:"

View File

@ -759,6 +759,18 @@ msgstr "Enviando datos al servidor (%s/%s)"
msgid "dashboard.import.progress.upload-media"
msgstr "Enviando fichero: %s"
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.check-error"
msgstr "No hemos podido verificar este archivo."
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.corrupt-file"
msgstr "Parece que este archivo está dañado."
#: src/app/main/ui/dashboard/import.cljs
msgid "dashboard.import.import-error.unknown-error"
msgstr "Se ha producido un error al procesar este archivo."
#: src/app/main/ui/dashboard/team.cljs:765
msgid "dashboard.invitation-modal.delete"
msgstr "Vas a eliminar las invitaciones para:"