Discussions

Ask a Question
Back to all

Need better error handling for inventory updates

When I tested with negative inventory:

var body = [{ //sample
      supc: "SDL480972036",
      availableInventory: "-1"
    }, {
      supc: "SDL480972037",
      availableInventory: "-100"
    }];

it was able to validate and send me an error.

But when I tested with junk SUPCs:

var body = [{ //sample
      supc: "blue",
      availableInventory: "401"
    }, {
      supc: "blah",
      availableInventory: "41"
    }];

it did not offer any validation or errors. Perhaps you are trying to save time by not hitting the DB to check SUPCs? I can understand wanting to queue up as quickly as possible but are you really happy with that much? I'm willing to brainstorm some ideas for better error handling like a webhook where the results from the updates are reported asynchronosly.