Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
Errorobject and specific error objects such asTypeErrorare fully standardized in the ECMAScript specification. There are, however, common non-standard properties of these objects available in most browsers.You can throw whatever you like, so long as your error handling code knows what to do with the objects you throw, but there are advantages to using
Errorobjects:messageproperty, so you don’t have to write different code to handle native errors and your own errors;Errorobjects in Mozilla and other browsers have very useful non-standard properties, such asfileName,lineNumberandstack. You only get these onErrorobjects and they can be very useful for debugging.