internxt: surface re-login error when re-auth fails in NewFs
When the stored token is expired and refreshOrReLogin fails, the returned error wrapped the original 401 and discarded authErr, hiding the actionable reason (e.g. "account requires 2FA - please run: rclone config reconnect remote:"). Wrap both errors so the user sees why re-auth failed and what to do about it. Fixes #9583 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
committed by
Nick Craig-Wood
co-authored by
Claude Fable 5
parent
171e86369a
commit
9f4845a40c
@@ -343,7 +343,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
fs.Debugf(f, "getUserInfo returned 401, attempting re-auth")
|
||||
authErr := f.refreshOrReLogin(ctx)
|
||||
if authErr != nil {
|
||||
return nil, fmt.Errorf("failed to fetch user info (re-auth failed): %w", err)
|
||||
return nil, fmt.Errorf("failed to fetch user info (re-auth failed: %w): %w", authErr, err)
|
||||
}
|
||||
userInfo, err = getUserInfo(ctx, &userInfoConfig{Token: f.cfg.Token})
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user