javascript fetch catch code example
Example: .fetch method
fetch('http://example.com/data.json')
.then(data => data);
.catch(err => console.log(err));
fetch('http://example.com/data.json')
.then(data => data);
.catch(err => console.log(err));