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/NonFatal

NonFatal

scala.util.control.NonFatal
objectNonFatal

Extractor of non-fatal Throwables. Will not match fatal errors likeVirtualMachineError (for example,OutOfMemoryError andStackOverflowError, subclasses ofVirtualMachineError),ThreadDeath,LinkageError,InterruptedException,ControlThrowable.

Note thatscala.util.control.ControlThrowable, an internal Throwable, is not matched byNonFatal (and would therefore be thrown).

For example, all harmless Throwables can be caught by:

try {  // dangerous stuff} catch {  case NonFatal(e) => log.error(e, "Something not that bad.") // or  case e if NonFatal(e) => log.error(e, "Something not that bad.")}

Attributes

Source
NonFatal.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type

Members list

Value members

Concrete methods

Returns true if the providedThrowable is to be considered non-fatal, or false if it is to be considered fatal

Returns true if the providedThrowable is to be considered non-fatal, or false if it is to be considered fatal

Attributes

Source
NonFatal.scala

Returns Some(t) if NonFatal(t) == true, otherwise None

Returns Some(t) if NonFatal(t) == true, otherwise None

Attributes

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

[8]ページ先頭

©2009-2025 Movatter.jp