I am working with the node-instagram api (javascript). Occasionally, I get errors whenever I make a get request with the api. I want to display a particular error message when an ECONNRESET exception is raised, and then display a generic error message for all the other types of exception. My code so far looks like this:
instagram.get('users/self/media/recent').then(data => {
console.log(data)
}).catch(err => {
console.log(err)
});
How can I alter the promise to make it also recognise ECONNRESET exceptions and display a different error message when it catches them?