.

Mpx.Exception

Declaration

Visual Basic

 
   Class Mpx.Exception
     Public System.ApplicationException

     Public Error    As Mpx.Error
     Public File     As String
     Public Line     As Int32
   End Class

C#

 
   class Mpx.Exception :
     public System.ApplicationException
   {
     
     public Mpx.Error Error;
     public string    File;
     public int       Line;
   }

 

Description

Exception is thrown when an MPX error occurs.

 
Mpx.Exception members
Member
Description
Notes
Error
The MPX error code describing the type of error that occurred.  

File

The MPX source code file where the exception originated.

This information is helpful to Kollmorgen support when trying to help users understand the particular reasons an exception was generated.

Line

The MPX source code line where the exception originated.

This information is included in the information returned by the ToString() method.

Since ToString() returns other useful information, it is recommended that the text returned from ToString() is logged and reported to Kollmorgen when troubleshooting.


 
Base class members
Member
Description
Notes
Message

A text string representation of the error that occurred.

 
StackTrace

A text representation of the application call stack when the error occurred.

 
Source

The name of the application or the object that caused the error.  This is usually “MPXNET”

 
ToString()

A String representation of the exception.

ToString() returns the information from all Mpx.Exception members.

This is helpful to Kollmorgen support when trying to help users understand the particular reasons an exception was generated.

Sample Code

The following code calls an undefined function Foo. The first catch statement will catch an Mpx.Exception and log the information returned from ToString()to a file.

Visual Basic

 
Try
    Foo()
Catch e As mpx. Exception
    LogToFile(ex.ToString())
    ' Perform any other appropriate error handling
Catch e As System.Exception
    ' Handle non-MPX exceptions appropriately
End Try

C#

 
try
{
    Foo();
}
catch (Mpx.Exception e) 
{
    LogToFile(ex.ToString());
    // Perform any other appropriate error handling
}
catch (System.Exception e) 
{
    // Handle non-MPX exceptions appropriately
}

See Also

MPX Error Handling

Assertion Events

External References

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering