Avoid consuming fetch response twice (#4460) Fixes #4459 Co-authored-by: as-gh2 <->
Signed| @@ -544,10 +544,13 @@ async function downloadJannyCharacter(uuid) { | ||
| 544 | 544 | const fileType = imageResult.headers.get('content-type'); |
| 545 | 545 | |
| 546 | 546 | return { buffer, fileName, fileType }; |
| 547 | + } else { | |
| 548 | + console.error('Janny failed to download', downloadResult); | |
| 547 | 549 | } |
| 550 | + } else { | |
| 551 | + console.error('Janny returned error', result.statusText, await result.text()); | |
| 548 | 552 | } |
| 549 | 553 | |
| 550 | - console.error('Janny returned error', result.statusText, await result.text()); | |
| 551 | 554 | throw new Error('Failed to download character'); |
| 552 | 555 | } |
| 553 | 556 | |