Made errors respond 502 instead of 409.

This commit is contained in:
Ajay Ramachandran
2019-12-24 11:05:11 -05:00
parent 69f1bff0a1
commit 54455bf625

View File

@@ -207,8 +207,8 @@ app.get('/api/postVideoSponsorTimes', async function (req, res) {
//not a duplicate, execute query //not a duplicate, execute query
db.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)").run(videoID, startTime, endTime, startingVotes, UUID, userID, timeSubmitted, 0, shadowBanned, function (err) { db.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)").run(videoID, startTime, endTime, startingVotes, UUID, userID, timeSubmitted, 0, shadowBanned, function (err) {
if (err) { if (err) {
//a DB change probably occurred, respond as if it is a duplicate //a DB change probably occurred
res.sendStatus(409); res.sendStatus(502);
console.log("Error when putting sponsorTime in the DB: " + videoID + ", " + startTime + ", " + "endTime" + ", " + userID); console.log("Error when putting sponsorTime in the DB: " + videoID + ", " + startTime + ", " + "endTime" + ", " + userID);
} else { } else {