mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 14:07:09 +03:00
add ignores for impossible cases
This commit is contained in:
@@ -21,7 +21,7 @@ export async function getIsUserVIP(req: Request, res: Response): Promise<Respons
|
|||||||
hashedUserID: hashedUserID,
|
hashedUserID: hashedUserID,
|
||||||
vip: vipState,
|
vip: vipState,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) /* instanbul ignore next */ {
|
||||||
Logger.error(err as string);
|
Logger.error(err as string);
|
||||||
return res.sendStatus(500);
|
return res.sendStatus(500);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ async function dbGetUserSummary(userID: HashedUserID, fetchCategoryStats: boolea
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) /* instanbul ignore next */ {
|
||||||
Logger.error(err as string);
|
Logger.error(err as string);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ async function dbGetUsername(userID: HashedUserID) {
|
|||||||
try {
|
try {
|
||||||
const row = await db.prepare("get", `SELECT "userName" FROM "userNames" WHERE "userID" = ?`, [userID]);
|
const row = await db.prepare("get", `SELECT "userName" FROM "userNames" WHERE "userID" = ?`, [userID]);
|
||||||
return row?.userName ?? userID;
|
return row?.userName ?? userID;
|
||||||
} catch (err) {
|
} catch (err) /* instanbul ignore next */ {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export async function getViewsForUser(req: Request, res: Response): Promise<Resp
|
|||||||
} else {
|
} else {
|
||||||
return res.sendStatus(404);
|
return res.sendStatus(404);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) /* instanbul ignore next */ {
|
||||||
Logger.error(err as string);
|
Logger.error(err as string);
|
||||||
return res.sendStatus(500);
|
return res.sendStatus(500);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user