try catch return error with message js code example Example: try catch error try { console.log('hello'); } catch (e){ }