Catch

Example
try { if (1==2){ throw new error("1 will never be 2") } } catch (errMsg){ alert(errMsg.message); }