.NET Interface >

$NETExceptionHandler

$NETExceptionHandler
allows you to control how exceptions thrown in .NET are handled in Mathematica.
  • The default behavior is for exceptions to appear as messages in Mathematica. To override this behavior (e.g., to temporarily silence messages from exceptions), assign a value to $NETExceptionHandler.
symbol associated with the messageusually the symbol NET
message tagtypically "netexceptn" or "netpexceptn"
string descriptiona descriptive string associated with the exception
  • The tag "netexceptn" generally is used for a typical exception, while the tag "netpexceptn" is used for exceptions generated by a manual return, where the exception occurs after the function has sent its result back to Mathematica.
  • You can use GetNETException in a handler function to obtain the .NET exception object manually.
Needs["NETLink`"]
  • This silences messages:
In[2]:=
Click for copyable input
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF