diff --git a/src/utils/curseforge-utils.ts b/src/utils/curseforge-utils.ts index 019f2cf..6e13bd6 100644 --- a/src/utils/curseforge-utils.ts +++ b/src/utils/curseforge-utils.ts @@ -97,7 +97,11 @@ export async function uploadFile(id: string, data: Record, file: Fi }); if (!response.ok) { - throw new Error(`Failed to upload file: ${response.status} (${response.statusText})`) + let errorText = response.statusText; + try { + errorText += `, ${await response.text()}`; + } catch { } + throw new Error(`Failed to upload file: ${response.status} (${errorText})`); } return (<{ id: number }>await response.json()).id; diff --git a/src/utils/modrinth-utils.ts b/src/utils/modrinth-utils.ts index d98642d..38886a7 100644 --- a/src/utils/modrinth-utils.ts +++ b/src/utils/modrinth-utils.ts @@ -23,7 +23,11 @@ export async function createVersion(id: string, data: Record, files }); if (!response.ok) { - throw new Error(`Failed to upload file: ${response.status} (${response.statusText})`) + let errorText = response.statusText; + try { + errorText += `, ${await response.text()}`; + } catch { } + throw new Error(`Failed to upload file: ${response.status} (${errorText})`); } return (<{ id: string }>await response.json()).id;