Skip to content

Q: Is it possible to use try in an exception handler? #300

@torsten-liermann

Description

@torsten-liermann

Hi,

I feel like drunk when I see the forest from lambda expressions ...

Is it possible to use Try in an exception handler? The exception handler is a technical construct that treats a given exception differently depending on the exception type. For example:

void globalIntegrationExceptionHandler(Throwable e) {
...
Try.withException(e)
  .onFail(Exception1.class, ...)
  .onFail(Exception2.class, ...)

Thanks for a hint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions