mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-13 23:17:02 +03:00
Made errors respond 502 instead of 409.
This commit is contained in:
4
index.js
4
index.js
@@ -207,8 +207,8 @@ app.get('/api/postVideoSponsorTimes', async function (req, res) {
|
||||
//not a duplicate, execute query
|
||||
db.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)").run(videoID, startTime, endTime, startingVotes, UUID, userID, timeSubmitted, 0, shadowBanned, function (err) {
|
||||
if (err) {
|
||||
//a DB change probably occurred, respond as if it is a duplicate
|
||||
res.sendStatus(409);
|
||||
//a DB change probably occurred
|
||||
res.sendStatus(502);
|
||||
|
||||
console.log("Error when putting sponsorTime in the DB: " + videoID + ", " + startTime + ", " + "endTime" + ", " + userID);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user