EngineHub / EngineHub/CommandHelper

Add tryelse()

Open
#1,196 0 comments 0 reactions 0 assignees View on GitHub
feature request good first issue
Dominant language
Java
Stars
128
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Add a function tryelse, which accepts two statement, trying the first one, and returning it if successful, otherwise, returning the else.

```
string @a = tryelse(functionThatThrows(), 'default');
```
If scream-errors is true, the exception will still be logged.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.