Tengo una llamada en una cadena Promise que podría fallar y, en determinadas condiciones, quiero ignorar ese error. ¿Es posible decirle a la promesa que debe continuar como un éxito?
Como esto:
function do() { return possiblyFailingCall.then(function(response) { // handle successful response return response.data; }, function (error) { if (error && error.statusCode === 404) { // ah, this is not really an error; I wanto to return an empty object now return {}; // <- this is where I want to return to the success-route } else { // this is actually an error that I want to pass on in the promise chain } }); } do().then(function(data) { // in the case of the 404 (not found), I want to get an empty object }, function(error) { // I do not want to see the 404 error here, but I want to see all other errors });