This class is the base class to catch exceptions thrown by prolog in C#.
| C# | Visual Basic | Visual C++ |
[SerializableAttribute] public class PlException : Exception, ISerializable
<SerializableAttribute> _ Public Class PlException _ Inherits Exception _ Implements ISerializable
[SerializableAttribute] public ref class PlException : public Exception, ISerializable
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| PlException()()() |
Initializes a new instance of the Exception class.
| |
| PlException(String) |
Initializes a new instance of the Exception class with a specified error message.
| |
| PlException(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.
| |
| PlException(SerializationInfo, StreamingContext) |
Initializes a new instance of the Exception class with serialized data.
| |
| PlException(PlTerm) | To catch a exception thrown by prolog For a example see PlException. | |
| Data |
Gets a collection of key/value pairs that provide additional user-defined information about the exception.
(Inherited from Exception.) | |
| Equals(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.
(Overrides Exception.GetObjectData(SerializationInfo, StreamingContext).) | |
| 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.
(Overrides Exception.Message.) | |
| MessagePl | provide somtimes some additional information about the exceptions reason. | |
| PlThrow()()() |
TODO
| |
| 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.
| |
| Throw()()() |
TODO
| |
| ToString()()() |
The exception is translated into a message as produced by print_message/2. The character data is stored in a ring.
(Overrides Exception.ToString()()().) |
public void prolog_exception_sample() { string exception_text = "test_exception"; Assert.IsTrue(PlQuery.PlCall("assert( (test_throw :- throw(" + exception_text + ")) )")); try { Assert.IsTrue(PlQuery.PlCall("test_throw")); } catch (PlException ex) { Assert.AreEqual(exception_text, ex.Term.ToString()); Assert.AreEqual("Unknown message: " + exception_text, ex.Message); } }
| Object | |||
| Exception | |||
| PlException | |||
| PlTypeException | |||