try catch javascript await code example
Example: await and catch javascript
var response = await promisedFunction().catch((err) => { console.error(err); });
// response will be undefined if the promise is rejected
// this will work instead of using try...catch...