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

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

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      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.

        Issue Links

          Activity

          Hide
          psoper Pete Soper (Inactive) added a comment -
          BT2:EVALUATION

          This is a reasonable request and the description has been added to the description for duplicate request 5050783 and the priority of the latter was increased.
          Show
          psoper Pete Soper (Inactive) added a comment - BT2:EVALUATION This is a reasonable request and the description has been added to the description for duplicate request 5050783 and the priority of the latter was increased.

            People

            • Assignee:
              Unassigned
              Reporter:
              rlewis Roger Lewis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: