Add upload response status logging to handleImageUpload
Help diagnose why uploads succeed but show "Upload failed" error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1241,8 +1241,10 @@ export function renderToolbar(config: ToolbarConfig): string {
|
||||
});
|
||||
})
|
||||
.then(function(r) {
|
||||
console.log("[emdash] Upload response status:", r.status);
|
||||
if (!r.ok) {
|
||||
return r.json().then(function(e) {
|
||||
console.log("[emdash] Upload error response:", JSON.stringify(e));
|
||||
var msg = (e && e.error && e.error.message) ? e.error.message : ("Upload failed: " + r.status);
|
||||
throw new Error(msg);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user