Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Catch Watchdog upstream error. (#4871) (#4919)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba authored and jaredhirsch committed Sep 20, 2018
1 parent c3c6cb7 commit e4bd0a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/src/watchdog.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ exports.handleResult = function(req) {
throw err;
}

// Check if there was an upstream error at PhotoDNA.
// We leave the result as null.
if (req.body.error) {
const err = new Error(`Watchdog submission encountered an error at PhotoDNA.`);
err.watchdogSubmissionId = String(record.id);
err.photodnaResponseStatus = req.body.response.Status;
throw err;
}

if (req.body.positive) {
handlePositive(record);
} else {
Expand Down

0 comments on commit e4bd0a5

Please sign in to comment.