ResultExecution

Companion:
class
class Object
trait Matchable
class Any

Value members

Inherited methods

def effectively(result: => Result): Result

execute a Result and rethrow any exception or throws an exception if it is not a success

execute a Result and rethrow any exception or throws an exception if it is not a success

Inherited from:
ResultExecution
def exception(t: Throwable): Result

turn an exception into a result

turn an exception into a result

Inherited from:
ResultExecution
def execute[T, R](code: => T)(convert: T => R)(using evidence$1: AsResult[R]): Result

execute a piece of code and return a result:

execute a piece of code and return a result:

  • if the code already returns a result, just keep it
  • if the code throws an Exception return an Error
  • if the code returns a value of type T, convert it to a result
Inherited from:
ResultExecution
def execute(result: => Result): Result

execute a Result and return a Result even if there are specs2 exceptions

execute a Result and return a Result even if there are specs2 exceptions

Inherited from:
ResultExecution
def executeEither[T, R](code: => T)(using convert: T => R): Either[Result, R]

execute a piece of code and return a result, either as a Left(failure) or a Right(value)

execute a piece of code and return a result, either as a Left(failure) or a Right(value)

Inherited from:
ResultExecution
def executeProperty[T](prop: Property[T], default: Result): Either[Result, T]

execute a Property returning the value if it exists and a Success result otherwise

execute a Property returning the value if it exists and a Success result otherwise

Inherited from:
ResultExecution
def executeThrowable(res: => Result): Either[Result, Result]

execute a result and return either as a Left(result) if something was thrown or a Right(result)

execute a result and return either as a Left(result) if something was thrown or a Right(result)

Inherited from:
ResultExecution
def handleExceptionsPurely: PartialFunction[Throwable, Result]

handle result exceptions and do not rethrow them

handle result exceptions and do not rethrow them

Inherited from:
ResultExecution

Extensions

Inherited extensions

extension (r: => Result)
@targetName("execute_postfix")
def execute(using n: Int): Result

this extension allows the execution of a Result with an execute method

this extension allows the execution of a Result with an execute method

Inherited from:
ResultExecution