mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: enhance error handling for remote attachment index loading
This commit is contained in:
+13
-1
@@ -113,7 +113,19 @@ async function loadRemoteAttachmentIndex(session: RemoteBackupTransferSession):
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const message = error instanceof Error ? error.message : String(error);
|
const message = error instanceof Error ? error.message : String(error);
|
||||||
if (message.includes('404') || message.includes('Please select a backup file')) {
|
const normalized = message.toLowerCase();
|
||||||
|
// Some WebDAV providers return non-standard codes such as 530 when the
|
||||||
|
// attachment index does not exist yet. Treat these "missing file" style
|
||||||
|
// responses as an empty index so first-time incremental backups can proceed.
|
||||||
|
if (
|
||||||
|
normalized.includes('404')
|
||||||
|
|| normalized.includes('403')
|
||||||
|
|| normalized.includes('530')
|
||||||
|
|| normalized.includes('not found')
|
||||||
|
|| normalized.includes('file not found')
|
||||||
|
|| normalized.includes('does not exist')
|
||||||
|
|| normalized.includes('please select a backup file')
|
||||||
|
) {
|
||||||
return new Map<string, number>();
|
return new Map<string, number>();
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user