add ignore next to catch errors

This commit is contained in:
Michael C
2022-09-25 03:29:31 -04:00
parent 8562dc2240
commit 506b6570f3
17 changed files with 34 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ function getFuzzyUserID(userName: string): Promise<{userName: string, userID: Us
try {
return db.prepare("all", `SELECT "userName", "userID" FROM "userNames" WHERE "userName"
LIKE ? ESCAPE '\\' LIMIT 10`, [userName]);
} catch (err) {
} catch (err) /* istanbul ignore next */ {
return null;
}
}
@@ -20,7 +20,7 @@ function getFuzzyUserID(userName: string): Promise<{userName: string, userID: Us
function getExactUserID(userName: string): Promise<{userName: string, userID: UserID }[]> {
try {
return db.prepare("all", `SELECT "userName", "userID" from "userNames" WHERE "userName" = ? LIMIT 10`, [userName]);
} catch (err) {
} catch (err) /* istanbul ignore next */{
return null;
}
}
@@ -42,6 +42,7 @@ export async function getUserID(req: Request, res: Response): Promise<Response>
: await getFuzzyUserID(userName);
if (results === undefined || results === null) {
/* istanbul ignore next */
return res.sendStatus(500);
} else if (results.length === 0) {
return res.sendStatus(404);