sentence: they follow a syntax similar to that used in java : try -lcb- statement ; -rcb- catch ( e if e = = '' invalidnameexception '' ) -lcb- statement ; -rcb- catch ( e if e = = '' invalididexception '' ) -lcb- statement ; -rcb- catch ( e if e = = '' invalidemailexception '' ) -lcb- statement ; -rcb- catch ( e ) -lcb- statement ; -rcb- in a browser , the onerror event is more commonly used to trap exceptions .