Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.util/scala.util.control/Exception/Catch

Catch

scala.util.control.Exception.Catch
classCatch[+T](valpf:Catcher[T],valfin:Option[Finally] = ...,valrethrow:Throwable=>Boolean = ...) extendsDescribed

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 of bodies used in try and catch blocks

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 caughtThrowable

Attributes

Source
Exception.scala
Graph
Supertypes
traitDescribed
classObject
traitMatchable
classAny

Members list

Value members

Concrete methods

defandFinally(body:=>Unit):Catch[T]

Create a new Catch container from this object and the supplied finally body.

Create 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
defapply[U >:T](body:=>U):U

Apply this catch logic to the supplied body.

Apply this catch logic to the supplied body.

Attributes

Source
Exception.scala
defeither[U >:T](body:=>U):Either[Throwable,U]

Apply this catch logic to the supplied body, mapping the result intoEither[Throwable, T] -Left(exception) if an exception was caught,Right(T) otherwise.

Apply this catch logic to the supplied body, mapping the result intoEither[Throwable, T] -Left(exception) if an exception was caught,Right(T) otherwise.

Attributes

Source
Exception.scala
defopt[U >:T](body:=>U):Option[U]

Apply this catch logic to the supplied body, mapping the result intoOption[T] -None if any exception was caught,Some(T) otherwise.

Apply this catch logic to the supplied body, mapping the result intoOption[T] -None if any exception was caught,Some(T) otherwise.

Attributes

Source
Exception.scala
defor[U >:T](pf2:Catcher[U]):Catch[U]

Create a new Catch with additional exception handling logic.

Create a new Catch with additional exception handling logic.

Attributes

Source
Exception.scala
defor[U >:T](other:Catch[U]):Catch[U]

Attributes

Source
Exception.scala

Convenience methods.

Convenience methods.

Attributes

Source
Exception.scala
deftoTry:Catch[Try[T]]

Attributes

Source
Exception.scala
defwithApply[U](f:Throwable=>U):Catch[U]

Create aCatch object with the sameisDefinedAt logic as this one, but with the suppliedapply method replacing the current one.

Create aCatch object with the sameisDefinedAt logic as this one, but with the suppliedapply method replacing the current one.

Attributes

Source
Exception.scala
defwithTry[U >:T](body:=>U):Try[U]

Apply this catch logic to the supplied body, mapping the result intoTry[T] -Failure if an exception was caught,Success(T) otherwise.

Apply this catch logic to the supplied body, mapping the result intoTry[T] -Failure if an exception was caught,Success(T) otherwise.

Attributes

Source
Exception.scala

Inherited methods

Attributes

Inherited from:
Described
Source
Exception.scala
overridedeftoString():String

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
defwithDesc(s:String):this.type

Attributes

Inherited from:
Described
Source
Exception.scala

Concrete fields

Attributes

Source
Exception.scala
valpf:Catcher[T]

Attributes

Source
Exception.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp