Error handler for javascript that makes handling errors in javascript more convienent