Description
A DESCRIPTION OF THE REQUEST :
Please consider adding a method to get a stacktrace in the form of a String from Throwable.
JUSTIFICATION :
We log our stacktraces over the network, and they need to be converted to Strings. We do this in a helper class currently which we used to use on all our exceptions. To be more object oriented we have overridden toString() in our exception classes so we can treat all exceptions the same without a helper class.
However, when we want to log a full stacktrace although we have created a method toStacktrace() in our exception classes we still need to use a helper class to get the stacktrace into a string from the Java exception classes, making it so we need 2 catch blocks.
This is picky, but it's super easy to fix, and it's bugging us.
Please consider adding a method to get a stacktrace in the form of a String from Throwable.
JUSTIFICATION :
We log our stacktraces over the network, and they need to be converted to Strings. We do this in a helper class currently which we used to use on all our exceptions. To be more object oriented we have overridden toString() in our exception classes so we can treat all exceptions the same without a helper class.
However, when we want to log a full stacktrace although we have created a method toStacktrace() in our exception classes we still need to use a helper class to get the stacktrace into a string from the Java exception classes, making it so we need 2 catch blocks.
This is picky, but it's super easy to fix, and it's bugging us.
Attachments
Issue Links
- duplicates
-
JDK-5050783 Throwable convenience method: String getStackTraceString()
- Open