From bbec5f6496e78952faba38549ea40aa4d2bff941 Mon Sep 17 00:00:00 2001 From: iacore Date: Sat, 5 Oct 2024 15:22:14 +0000 Subject: [PATCH] cleanup --- core/requests.go | 11 ++++++----- core/user.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/requests.go b/core/requests.go index 5ab1bb6..12dd738 100644 --- a/core/requests.go +++ b/core/requests.go @@ -65,11 +65,12 @@ func retryRequest(ctx context.Context, reqFunc func(context.Context, string) (*r if token == nil && !isPost { tokenManager.ResetAllTokens() - return nil, i18n.Errorf("All tokens (%d) are timed out, resetting all tokens to their initial good state.\n"+ - "Consider providing additional tokens in PIXIVFE_TOKEN or reviewing API request level backoff configuration.\n"+ - "Please refer the following documentation for additional information:\n"+ - "- https://pixivfe-docs.pages.dev/hosting/obtaining-pixivfe-token/\n"+ - "- https://pixivfe-docs.pages.dev/hosting/environment-variables/#exponential-backoff-configuration", + return nil, i18n.Errorf( + `All tokens (%d) are timed out, resetting all tokens to their initial good state. +Consider providing additional tokens in PIXIVFE_TOKEN or reviewing API request level backoff configuration. +Please refer the following documentation for additional information: +- https://pixivfe-docs.pages.dev/hosting/obtaining-pixivfe-token/ +- https://pixivfe-docs.pages.dev/hosting/environment-variables/#exponential-backoff-configuration`, len(config.GlobalConfig.Token)) } diff --git a/core/user.go b/core/user.go index 5e4edf7..9432ce2 100644 --- a/core/user.go +++ b/core/user.go @@ -31,7 +31,7 @@ func (s UserArtCategory) Validate() error { s != UserArt_Manga && s != UserArt_Bookmarks && s != UserArt_Novel { - return i18n.Errorf("Invalid work category: %#v. "+`Only "%s", "%s", "%s", "%s", "%s" and "%s" are available`, s, UserArt_Any, UserArt_AnyAlt, UserArt_Illustration, UserArt_Manga, UserArt_Bookmarks, UserArt_Novel) + return i18n.Errorf(`Invalid work category: %#v. Only "%s", "%s", "%s", "%s", "%s" and "%s" are available`, s, UserArt_Any, UserArt_AnyAlt, UserArt_Illustration, UserArt_Manga, UserArt_Bookmarks, UserArt_Novel) } else { return nil }