How inefficient is it to get the stack trace for an exception? I know it’s costly, but how costly? Should they definitely not be used in production environment?
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.
In a production environment, it’s helpful to log the stack trace so the user can find it when they contact tech support. Printing stack trace in place of an understandable (by the typical user) message should be avoided.
You shouldn’t be concerned with the efficiency of exceptional blocks of code. Error recovery is the most important thing here.