Skip to content

NcursesBridge.init() throws raw Throwable instead of specific exception types #228

@sfloess

Description

@sfloess

NcursesBridge.init() (line 248) declares 'throws Throwable' because of MethodHandle.invokeExact(). This forces all callers to catch Throwable, which is an anti-pattern that prevents proper exception handling. The checked exceptions from invokeExact() should be caught and wrapped in a specific RuntimeException subtype.

File: /home/sfloess/Development/github/FlossWare/curses-java/src/main/java/org/flossware/curses/ffi/NcursesBridge.java:248
Severity: medium
Category: maintainability
Found by: claude-opus-4-6

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-handlingError handling improvementsrobustnessCode robustness and reliability

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions