PlDomainException Constructor (message, innerException)

SbsSW.SwiPlCs

Copy image CopyHover image
Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog PlDomainException Constructor (message, innerException)
SwiPlCs interfaceSbsSW.SwiPlCs.ExceptionsPlDomainExceptionPlDomainException(String, Exception)

This class is the base class to catch exceptions thrown by prolog in C#.

Declaration Syntax
C# Visual Basic Visual C++ F#
public PlDomainException(
	string message,
	Exception innerException
)
Public Sub New ( 
	message As String,
	innerException As Exception
)
public:
PlDomainException(
	String^ message, 
	Exception^ innerException
)
new : 
        message : string * 
        innerException : Exception -> PlDomainException
Parameters
message (String)

[Missing <param name="message"/> documentation for "M:SbsSW.SwiPlCs.Exceptions.PlDomainException.#ctor(System.String,System.Exception)"]

innerException (Exception)

[Missing <param name="innerException"/> documentation for "M:SbsSW.SwiPlCs.Exceptions.PlDomainException.#ctor(System.String,System.Exception)"]

Examples
  Copy imageCopy
public void prolog_exception_sample()
{
    const string exceptionText = "test_exception";
    Assert.IsTrue(PlQuery.PlCall("assert( (test_throw :- throw(" + exceptionText + ")) )"));
    try
    {
        Assert.IsTrue(PlQuery.PlCall("test_throw"));
    }
    catch (PlException ex)
    {
        Assert.AreEqual(exceptionText, ex.Term.ToString());
        Assert.AreEqual("Unknown message: " + exceptionText, ex.Message);
    }
}

Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)