ArtemGet/teleroute

CmdFork

ArtemGet opened this issue · 0 comments

A new command type needs to be added. It must fork between two commands (or routes), and the condition of the fork must be whether the main command throws an exception or not. An example can be found in ForkRoute.

Example of usage:

new CmdFork(
            new Cmd(),
            new Cmd()
)

// if first command throws -> execute second command, if second throws -> log.warn and return Optional.empty()

new CmdFork(
            new Route(...),
            new Route(...)
)