Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 text

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]

Introduced in R2009b

Was this topic helpful?