Improve error messages when fetching description on babelio

This commit is contained in:
2026-03-24 17:23:06 +01:00
parent 843c5b5dbc
commit 5e6715d586
5 changed files with 11 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ import (
type TranslatedError struct {
Err error
Arg string
}
type HttpError struct {
@@ -67,6 +68,10 @@ func (e TranslatedError) Error() string {
return fmt.Sprintf("%v", e.Err)
}
func (e TranslatedError) ToTranslatedMessage(ac *appcontext.AppContext) string {
return fmt.Sprintf(i18nresource.GetTranslatedMessage(ac, e.Error()), e.Arg)
}
type apiValidationError struct {
Field string `json:"field"`
Err string `json:"error"`