Skip to content

ExceptionConverter.getStackTrace() is empty #1296

@maloewe-ona

Description

@maloewe-ona

Describe the bug

The getStackTrace() method of com.lowagie.text.ExceptionConverter always returns an empty array.

This is pretty problematic because if an ExceptionConverter exception propagates to user code, and is there logged for example (which might use getStackTrace()), the user will see no stack trace at all.

To Reproduce

new ExceptionConverter(new IOException("test")).getStackTrace()
// ==> StackTraceElement[0] {  }

Expected behavior

getStackTrace() should return the stack trace

Though generally, maybe it would be worth reconsidering if all this special handling in ExceptionConverter is really worth it, or if it could be a normal exception class which just sets the original exception as cause, without any of this special handling. Respectively revert 94f6a23.

That might make the exception more verbose, but would at least guarantee that no information is lost.

System

  • OpenPDF version: latest (4821449), respectively OpenPDF 2.0.3

Your real name

Please specify your full name here, so that we can verify your identity.
If you have a conflict of interest describe this here also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions