object MLException extends OperationCollection
Contains:
- Converters for exceptions raised in ML code (represented as IsabelleMLExceptions), see MLException.simpleIsabelleMLExceptionConverter and MLException.distinguishingIsabelleMLExceptionConverter)
- An control.ExceptionManager that makes Isabelle raise ML exceptions as subtypes of IsabelleMLException for certain well-known
exceptions such as
TERM,ERROR, etc. See MLException.ExceptionManager.
- Source
- MLException.scala
- Alphabetic
- By Inheritance
- MLException
- OperationCollection
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
ExceptionManager extends control.ExceptionManager
An implementation of control.ExceptionManager (for controlling how exceptions thrown in ML code are passed through to Scala) that returns more specific subclasses of IsabelleMLException for certain exceptions (see recognizeException for the known exceptions).
An implementation of control.ExceptionManager (for controlling how exceptions thrown in ML code are passed through to Scala) that returns more specific subclasses of IsabelleMLException for certain exceptions (see recognizeException for the known exceptions). Install it via Isabelle.SetupGeneral.exceptionManager.
-
abstract
class
IsabelleMLExceptionConverter extends Converter[IsabelleMLException]
MLValue.Converter for type IsabelleMLException[A].
MLValue.Converter for type IsabelleMLException[A].
- ML type:
exn. - Encoding of exception
eas an exception:e(that is, the exception is directly stored without any encoding in the object table which is possible since the object table stores all values encoded as exceptions).
- See also
MLValue.Converter for explanations what Converters are for. Override the function recognize if you want the returned exception to be some more informative subclass of IsabelleMLException. Two preconfigured instantiations for importing exist: simpleIsabelleMLExceptionConverter and distinguishingIsabelleMLExceptionConverter, see there.
- ML type:
-
class
Ops extends AnyRef
- Attributes
- protected
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
Ops(implicit isabelle: Isabelle, ec: ExecutionContext): Ops
Returns an instance of type Ops.
Returns an instance of type Ops. It is guaranteed that for each instance
isabelle, exactly one instance ofObsis created (using theecfrom the first such invocation). (If you see this doc string in a class different from OperationCollection but no definition of the class Ops, treat this function as if it was private.)- Definition Classes
- OperationCollection
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
init()(implicit isabelle: Isabelle, executionContext: ExecutionContext): Unit
Makes sure an Ops instance for the instance
isabelleis initialized.Makes sure an Ops instance for the instance
isabelleis initialized. This is useful when code needs to be sure that the global initialization inside the Ops class has happened (e.g., declarations of ML types via Isabelle.executeMLCodeNow) even if it does not access any of the fields in the Ops class.Can safely be called several times with the same
isabelleand/orexecutionContext.- Definition Classes
- OperationCollection
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newOps(implicit isabelle: Isabelle, ec: ExecutionContext): Ops
Should construct an instance of type Ops
Should construct an instance of type Ops
- Attributes
- protected
- Definition Classes
- MLException → OperationCollection
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
recognizeException(exception: IsabelleMLException, fallback: (IsabelleMLException) ⇒ IsabelleMLException = identity)(implicit ec: ExecutionContext): Future[IsabelleMLException]
Takes an IsabelleMLException and analyses whether it contains one of several known ML exceptions for which there are more informative subclasses of IsabelleMLException.
Takes an IsabelleMLException and analyses whether it contains one of several known ML exceptions for which there are more informative subclasses of IsabelleMLException. If so, returns a new more informative exception object that contains the same exception.
Known exception types are:
- ErrorMLException for
ERROR msg - FailMLException for
Fail msg - TheoryMLException for
THEORY (msg, theories) - TermMLException for
TERM (msg, terms) - CtermMLException for
CTERM (msg, cterms) - ThmMLException for
THM (msg, index, thms) - TypeMLException for
TYPE (msg, typs, terms) - MatchMLException for
MatchIn all other cases, the exception is returned unchanged. (You can change this with thefallbackargument.)
- exception
The exception to transform
- fallback
A function for transforming the exception if it is not any of the above
- ErrorMLException for
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
implicit
object
distinguishingIsabelleMLExceptionConverter extends IsabelleMLExceptionConverter
Preconfigured instance of IsabelleMLExceptionConverter.
Preconfigured instance of IsabelleMLExceptionConverter. For certain known kind of ML exceptions (such as
TERM _etc.), it returns subclasses of IsabelleMLException (such as TermMLException). It uses recognizeException to recognize the exception, see there for a list of all supported exceptions. Use by importing it. -
implicit
object
simpleIsabelleMLExceptionConverter extends IsabelleMLExceptionConverter
Preconfigured instance of IsabelleMLExceptionConverter.
Preconfigured instance of IsabelleMLExceptionConverter. It simply returns an IsabelleMLException without any extra processing. Use by importing it.