mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-11 00:38:28 +03:00
Add errors handling for USC.
This commit is contained in:
@@ -370,6 +370,18 @@ router.post("/scores", RequirePermissions("submit_score"), async (req, res) => {
|
||||
|
||||
const importDoc = (importRes.body as SuccessfulAPIResponse).body as ImportDocument;
|
||||
|
||||
if (importDoc.errors[0]) {
|
||||
logger.info(`USC Import Failed ${importDoc.errors[0].message}`, {
|
||||
importDoc,
|
||||
userID,
|
||||
});
|
||||
|
||||
return res.status(200).json({
|
||||
statusCode: STATUS_CODES.BAD_REQ,
|
||||
description: `${importDoc.errors[0].type} ${importDoc.errors[0].message}`,
|
||||
});
|
||||
}
|
||||
|
||||
if (!importDoc.scoreIDs[0]) {
|
||||
logger.warn(`No scoreID, but import was successful?`, {
|
||||
importDoc,
|
||||
|
||||
Reference in New Issue
Block a user