Catch
A container class for catch/finally logic.
Pass a different value for rethrow if you want to probably unwisely allow catching control exceptions and other throwables which the rest of the world may expect to get through.
Type parameters
- T
-
result type produced by the catch logic
Value parameters
- fin
-
finally logic which, if defined, will be invoked after catch logic
- pf
-
partial function used when applying catch logic to determine result value
- rethrow
-
predicate on throwables determining when to rethrow a caught Throwable
Attributes
- Source
- Exception.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Creates a new Catch container from this object and the supplied finally body.
Creates a new Catch container from this object and the supplied finally body.
Value parameters
- body
-
the additional logic to apply after all existing finally bodies
Attributes
- Source
- Exception.scala
Applies this catch logic to the supplied body.
Applies this catch logic to the supplied body.
Type parameters
- U
-
the result type of the body, a supertype of
T
Value parameters
- body
-
the code block to execute with exception handling
Attributes
- Source
- Exception.scala
Applies this catch logic to the supplied body, mapping the result into Either[Throwable, T] - Left(exception) if an exception was caught, Right(T) otherwise.
Applies this catch logic to the supplied body, mapping the result into Either[Throwable, T] - Left(exception) if an exception was caught, Right(T) otherwise.
Type parameters
- U
-
the result type of the body, a supertype of
T
Value parameters
- body
-
the code block to execute, whose result is wrapped in
Righton success
Attributes
- Source
- Exception.scala
Applies this catch logic to the supplied body, mapping the result into Option[T] - None if any exception was caught, Some(T) otherwise.
Applies this catch logic to the supplied body, mapping the result into Option[T] - None if any exception was caught, Some(T) otherwise.
Type parameters
- U
-
the result type of the body, a supertype of
T
Value parameters
- body
-
the code block to execute, whose result is wrapped in
Someon success
Attributes
- Source
- Exception.scala
Creates a new Catch with additional exception handling logic.
Creates a new Catch with additional exception handling logic.
Type parameters
- U
-
the result type of the combined catch logic, a supertype of
T
Value parameters
- pf2
-
the additional exception handler to combine with the existing one
Attributes
- Source
- Exception.scala
Attributes
- Source
- Exception.scala
Attributes
- Source
- Exception.scala
Convenience methods.
Attributes
- Source
- Exception.scala
Creates a Catch object with the same isDefinedAt logic as this one, but with the supplied apply method replacing the current one.
Creates a Catch object with the same isDefinedAt logic as this one, but with the supplied apply method replacing the current one.
Type parameters
- U
-
the result type of the new exception handler
Value parameters
- f
-
the function to apply to caught exceptions instead of the current handler
Attributes
- Source
- Exception.scala
Applies this catch logic to the supplied body, mapping the result into Try[T] - Failure if an exception was caught, Success(T) otherwise.
Applies this catch logic to the supplied body, mapping the result into Try[T] - Failure if an exception was caught, Success(T) otherwise.
Type parameters
- U
-
the result type of the body, a supertype of
T
Value parameters
- body
-
the code block to execute, whose result is wrapped in
Successon success
Attributes
- Source
- Exception.scala
Inherited methods
Attributes
- Inherited from:
- Described
- Source
- Exception.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
- Inherited from:
- Described
- Source
- Exception.scala
Attributes
- Inherited from:
- Described
- Source
- Exception.scala
Concrete fields
Attributes
- Source
- Exception.scala
Attributes
- Source
- Exception.scala
Attributes
- Source
- Exception.scala