Add better error handling for WebDAV backup response
Parse response as text first, then JSON to capture server errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1606,7 +1606,15 @@ async function backupToWebDAV() {
|
||||
})
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
const text = await response.text();
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(text);
|
||||
} catch (parseError) {
|
||||
console.error("Failed to parse response:", text);
|
||||
throw new Error("Server returned invalid response. Check error logs.");
|
||||
}
|
||||
|
||||
if (!data.success) {
|
||||
throw new Error(data.error || "WebDAV backup failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user