Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6326410

Throwable could use a method to get a stacktrace as a String

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      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.

            Unassigned Unassigned
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: