PlTypeException Class

SWI-Prolog SbsSW.SwiPlCs

Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog PlTypeException Class
SwiPlCs interfaceSbsSW.SwiPlCs.ExceptionsPlTypeException
A type error expresses that a term does not satisfy the expected basic Prolog type.
Declaration Syntax
C# Visual Basic Visual C++
[SerializableAttribute]
public class PlTypeException : PlException
<SerializableAttribute> _
Public Class PlTypeException _
	Inherits PlException
[SerializableAttribute]
public ref class PlTypeException : public PlException
Members
All Members Constructors Methods Properties



Icon Member Description
PlTypeException()()()()
Initializes a new instance of the Exception class.

PlTypeException(String)
Initializes a new instance of the Exception class with a specified error message.

PlTypeException(String, Exception)
Initializes a new instance of the Exception class with a specified error message and a reference to the inner exception that is the cause of this exception.

PlTypeException(SerializationInfo, StreamingContext)
Initializes a new instance of the Exception class with serialized data.

PlTypeException(PlTerm)

To catch a exception thrown by prolog

For a example see PlException.


PlTypeException(String, PlTerm)
Creates an ISO standard Prolog error term expressing the expected type and actual term that does not satisfy this type.

Data
Gets a collection of key/value pairs that provide additional user-defined information about the exception.
(Inherited from Exception.)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetBaseException()()()()
When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
(Inherited from Exception.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetObjectData(SerializationInfo, StreamingContext)
When overridden in a derived class, sets the SerializationInfo with information about the exception.
(Inherited from PlException.)
GetType()()()()
Gets the runtime type of the current instance.
(Inherited from Exception.)
HelpLink
Gets or sets a link to the help file associated with this exception.
(Inherited from Exception.)
HResult
Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.
(Inherited from Exception.)
InnerException
Gets the Exception instance that caused the current exception.
(Inherited from Exception.)
MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Message
Gets a message that describes the current exception.
(Inherited from PlException.)
MessagePl
provide somtimes some additional information about the exceptions reason.
(Inherited from PlException.)
PlThrow()()()()
TODO
(Inherited from PlException.)
Source
Gets or sets the name of the application or the object that causes the error.
(Inherited from Exception.)
StackTrace
Gets a string representation of the frames on the call stack at the time the current exception was thrown.
(Inherited from Exception.)
TargetSite
Gets the method that throws the current exception.
(Inherited from Exception.)
Term
Get the PlTerm of this exception.
(Inherited from PlException.)
Throw()()()()
TODO
(Inherited from PlException.)
ToString()()()()
The exception is translated into a message as produced by print_message/2. The character data is stored in a ring.
(Inherited from PlException.)
Examples
This sample demonstrate how to catch a PlTypeException in C# that is thrown somewhere int the prolog code.
CopyC#
public void prolog_type_exception_sample()
{
    try
    {
        Assert.IsTrue(PlQuery.PlCall("sumlist([1,error],L)"));
    }
    catch (PlTypeException ex)
    {
        Assert.AreEqual("is/2: Arithmetic: `error/0' is not a function", ex.Message);
    }
}
Inheritance Hierarchy
Object
Exception
  PlException
    PlTypeException

Assembly: SwiPlCs (Module: SwiPlCs) Version: 1.1.60301.0 (1.1.60301.0)