Error Class
All error types of the MAXON API are based on the maxon::ErrorInterface . This interface defines functions to set and get the information stored in the error object.
For creating new error types based on this interface see Error Types and 接口基础 .
Basic information stored in an error object is accessed with:
The following data may or may not be set, depending on the error:
// get info on the error const maxon::String message = error.GetMessage(); const maxon::SourceLocation location = error.GetLocation(); const maxon::String file(location. file );
// print DiagnosticOutput ( "Error \"@\" in file @" , message, file); }
Additionally, error objects provide these functions:
// This example calls a function that may fail. // If an error occurred, the error is printed to the console. iferr (CallAction()) { // print error err.DiagOutput(); }