Skip to content

Commit

Permalink
Merge pull request #22 from silvermine/elasticsearch-invalid-json
Browse files Browse the repository at this point in the history
fix: return ES JSON parse error to CFN instead of invoking Lambda retry
  • Loading branch information
jthomerson committed Apr 2, 2021
2 parents 1282d9e + 73d35f9 commit c89458e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/ElasticSearchClient.js
Expand Up @@ -51,8 +51,8 @@ module.exports = Class.extend({
try {
data.body = JSON.parse(responseBody);
} catch(e) {
console.log('Invalid JSON body:', responseBody);
throw e;
console.log('Invalid JSON body:', responseBody, e);
deferred.reject(new Error('Request failed due to invalid JSON body. Raw Body: ' + responseBody));
}
}

Expand Down

0 comments on commit c89458e

Please sign in to comment.