Vuo  2.0.0
Public Member Functions | List of all members
VuoCompilerException Class Reference

Description

An exception containing a list of issues that occurred while compiling a composition.

At least one of the issues should be an error (otherwise there's no reason to throw an exception). The issues may also include warnings.

Currently, compiler functions handle VuoCompilerIssues in two different ways. The older way is to create a new VuoCompilerIssue if there's an error and throw a VuoCompilerException for it. The newer way is for the function to have a VuoCompilerIssues parameter, for it to append errors and warnings to those VuoCompilerIssues, and for it to throw a VuoCompilerException containing those VuoCompilerIssues if there's an error. Unless you know that the function and its callees are all using the older way or all using the newer way, the recommended pattern for callers to handle both possibilities is:

Example:
try {
fun(issues);
} catch (VuoCompilerException &e) {
if (e.getIssues() != issues)
issues->append(e.getIssues());
}
cout << issues->getLongDescription(); // or whatever you want to do with issues

Definition at line 39 of file VuoCompilerException.hh.

Public Member Functions

 VuoCompilerException (const VuoCompilerIssue &issue)
 Constructor. More...
 
 VuoCompilerException (VuoCompilerIssues *issues, bool ownsIssues)
 Constructor. More...
 
 VuoCompilerException (void) throw ()
 Needed for this class to be the value type in an STL map. More...
 
 ~VuoCompilerException (void) throw ()
 Needed to prevent a build error. More...
 
VuoCompilerIssuesgetIssues (void) const
 Returns the list of issues. More...
 
const char * what () const throw ()
 Returns an HTML-formatted string containing short descriptions of all issues. More...
 

Constructor & Destructor Documentation

◆ VuoCompilerException() [1/3]

VuoCompilerException::VuoCompilerException ( const VuoCompilerIssue issue)

Constructor.

Definition at line 16 of file VuoCompilerException.cc.

◆ VuoCompilerException() [2/3]

VuoCompilerException::VuoCompilerException ( VuoCompilerIssues issues,
bool  ownsIssues 
)

Constructor.

If isOwner is true, the created VuoCompilerException is responsible for deallocating issues. Otherwise, the caller is responsible.

Definition at line 29 of file VuoCompilerException.cc.

◆ VuoCompilerException() [3/3]

VuoCompilerException::VuoCompilerException ( void  )
throw (
)
inline

Needed for this class to be the value type in an STL map.

Definition at line 44 of file VuoCompilerException.hh.

◆ ~VuoCompilerException()

VuoCompilerException::~VuoCompilerException ( void  )
throw (
)

Needed to prevent a build error.

Destructor.

Definition at line 39 of file VuoCompilerException.cc.

Member Function Documentation

◆ getIssues()

VuoCompilerIssues * VuoCompilerException::getIssues ( void  ) const

Returns the list of issues.

Definition at line 49 of file VuoCompilerException.cc.

◆ what()

const char * VuoCompilerException::what ( ) const
throw (
)

Returns an HTML-formatted string containing short descriptions of all issues.

Definition at line 57 of file VuoCompilerException.cc.


The documentation for this class was generated from the following files: