AnyhowResultExtension<S> extension

on

Methods

context(Object context) Result<S>

Available on Result<S>, provided by the AnyhowResultExtension extension

If Result is Ok returns this. Otherwise, returns an Err with the additional context. The context should not be an instance of Error.
withContext(Object fn()) Result<S>

Available on Result<S>, provided by the AnyhowResultExtension extension

If Result is Ok returns this. Otherwise, Lazily calls the function and returns an Err with the additional context. The context should not be an instance of Error.