fix: don't crash

This commit is contained in:
zkldi
2024-05-16 18:42:50 +01:00
parent b01f9983d0
commit ed89751f40
2 changed files with 10 additions and 2 deletions
+4
View File
@@ -51,6 +51,10 @@ const command: SlashCommand = {
interaction
);
if (typeof importDoc === "string") {
return importDoc;
}
return CreateImportEmbed(importDoc);
},
};
+6 -2
View File
@@ -112,8 +112,12 @@ export async function PerformScoreImport(
);
if (!initRes.success) {
logger.error(`Failed to perform score import on ${url}.`, { body });
throw new Error(`Failed to perform import on ${url}.`);
if (initRes.statusCode >= 500) {
logger.error(`Failed to perform score import on ${url}.`, { body });
throw new Error(`Failed to perform import on ${url}.`);
} else {
return initRes.description;
}
}
// this server does not defer imports to a scorequeue