mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 09:18:25 +03:00
fix: don't crash
This commit is contained in:
@@ -51,6 +51,10 @@ const command: SlashCommand = {
|
||||
interaction
|
||||
);
|
||||
|
||||
if (typeof importDoc === "string") {
|
||||
return importDoc;
|
||||
}
|
||||
|
||||
return CreateImportEmbed(importDoc);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user