how to try catch syntax error in java code example Example: try catch error try { console.log('hello'); } catch (e){ }