mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 15:37:07 +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
|
//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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user