mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 09:48:44 +00:00
surface non-onboarding; do not retry non-onboarded requests
This commit is contained in:
1 parent
e3abd500db
commit
fdc27b6ccd
2 files changed
+12
-1
No files matched your search
+3
@@ -31,6 +31,9 @@ pub async fn image_upload_from_file_with_session_auto_renew<P: AsRef<Path>>(
|
||||
|
||||
let err = match result {
|
||||
Ok(response) => return Ok((response, None)),
|
||||
// We can't retry some errors.
|
||||
Err(err @ SoraError::SoraUsernameNotYetCreated) => return Err(err),
|
||||
// Retry all other errors.
|
||||
Err(err) => err,
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,15 @@ Message: {
|
||||
|| message.contains("token_expired");
|
||||
|
||||
if cookie_expired {
|
||||
return SoraError::UnauthorizedCookieOrBearerExpired
|
||||
return SoraError::UnauthorizedCookieOrBearerExpired;
|
||||
}
|
||||
|
||||
let needs_onboarding =
|
||||
message.contains("You must onboard before using this service")
|
||||
|| message.contains("onboarding_required");
|
||||
|
||||
if needs_onboarding {
|
||||
return SoraError::SoraUsernameNotYetCreated;
|
||||
}
|
||||
|
||||
let status_code = status.as_u16();
|
||||
|
||||
Reference in new issue
Block a user