3ds Max C++ API Reference
exceptions.h File Reference

Classes

class  MAXScriptException
 
class  MAXScriptException::ScopedMXSCallstackCaptureDisable
 helper class for disabling mxs callstack capture if an exception is thrown. More...
 
class  MAXScriptException::ScopedCplusplusCallstackCaptureDisable
 helper class for disabling c++ callstack capture if a system exception is thrown. More...
 
class  MAXScriptRuntimeErrorException
 
class  UnknownSystemException
 
class  SignalException
 This is the exception that is thrown if the user breaks execution by pressing and holding the escape key. More...
 
class  CompileError
 
class  SyntaxError
 
class  TypeError
 
class  NoMethodError
 
class  AccessorError
 
class  AssignToConstError
 
class  ArgCountError
 
class  RuntimeError
 
class  UserThrownError
 
class  DebuggerRuntimeError
 
class  IncompatibleTypes
 
class  ConversionError
 
class  FunctionReturn
 
class  LoopExit
 
class  LoopContinue
 
class  MaxShutdownException
 
class  CallStackOverflowException
 Exception thrown when calling a scripted function with less than 256k program call stack remaining. More...
 
class  SecurityException
 Exception thrown when attempting to execute MAXScript commands that are disallowed by ISceneScriptSecurityManager. More...
 

Macros

#define unimplemented(m, t)   throw NoMethodError (m, t)
 

Functions

ScripterExport void ProcessMAXScriptException (MAXScriptException &e, const MCHAR *caption, bool displayErrorMessageBox, bool showSourcePosition, bool isTerminalHandling, bool quietErrors=false)
 This method centralizes the handling of maxscript exceptions in c++ code. More...
 

Variables

MCHARnull_string
 

Macro Definition Documentation

◆ unimplemented

#define unimplemented (   m,
 
)    throw NoMethodError (m, t)

Function Documentation

◆ ProcessMAXScriptException()

ScripterExport void ProcessMAXScriptException ( MAXScriptException e,
const MCHAR caption,
bool  displayErrorMessageBox,
bool  showSourcePosition,
bool  isTerminalHandling,
bool  quietErrors = false 
)

This method centralizes the handling of maxscript exceptions in c++ code.

It's typical usage looks like:

ScopedMaxScriptEvaluationContext scopedMaxScriptEvaluationContext; MAXScript_TLS* _tls = scopedMaxScriptEvaluationContext.Get_TLS(); two_value_locals_tls( thingValue, propNameValue ); try { ScopedSaveCurrentFrames scopedSaveCurrentFrames(_tls); vl.thingValue = InterfaceFunction::FPValue_to_val( thing ); vl.propNameValue = Name::intern( propName ); vl.thingValue = vl.thingValue->get_property( &vl.propNameValue, 1 ); vl.thingValue->to_fpvalue( retVal ); } catch (MAXScriptException& e) { ProcessMAXScriptException(e, _T("GetScriptedProperty"), false, false, true); } catch (...) { ProcessMAXScriptException(UnknownSystemException(), _T("GetScriptedProperty"), false, false, true); }

Parameters
eThe maxscript exception to process
captionThe string to be used in the title bar of the error message box, and is used as part of the verbose description of the exception. Can be null.
displayErrorMessageBoxIf true, an error message box is displayed (unless max is in quiet mode).
showSourcePositionIf true, source position of error is shown in maxscript editor.
isTerminalHandlingIf true, terminal handling of the exception is occurring. If false, the catch will be rethrowing the exception.
quietErrorsIf true, error information is not written to Listener, a brief description of the exception and its source location is written to the log file.

Variable Documentation

◆ null_string

MCHAR* null_string
extern