NET.NetException class

Package: NET

Capture error information for .NET exception

Description

Process information from a NET.NetException object to handle .NET errors. This class is derived from MException.

Construction

e = NET.NetException(msgID,errMsg,netObj) constructs instance e of NET.NetException class.

Input Arguments

msgID

message identifier

errMsg

error message string

netObj

System.Exception object that caused the exception

Properties

ExceptionObject

System.Exception class causing the error.

Methods

Inherited Methods

See the methods of the base class MException.

Examples

Display error information after trying to load an unknown assembly:

try
  NET.addAssembly('C:\Work\invalidfile.dll')
catch e
  e.message;
  if(isa(e, 'NET.NetException'))
    eObj = e.ExceptionObject
  end
end
ans =
Message: Could not load file or assembly 
  'file:///C:\Work\invalidfile.dll' or 
  one of its dependencies. The system cannot 
  find the file specified.
Source: mscorlib
HelpLink: 

eObj = 
  FileNotFoundException with properties:

           Message: [1x1 System.String]
          FileName: [1x1 System.String]
         FusionLog: [1x1 System.String]
              Data: [1x1 System.Collections.ListDictionaryInternal]
    InnerException: []
        TargetSite: [1x1 System.Reflection.RuntimeMethodInfo]
        StackTrace: [1x1 System.String]
          HelpLink: []
            Source: [1x1 System.String]
Was this topic helpful?