    

 ## On this page

  

 

 # ansys::Project::Error Class Reference

 Last update: 24.03.2026 

The return state / error value of a [Project](classansys_1_1_project_1_1_project.xhtml "Base class for Project API, also see SimProject.") function call. [More...](classansys_1_1_project_1_1_error.xhtml#details)

`#include "Error.hpp"`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [Error](classansys_1_1_project_1_1_error.xhtml#aa79933ec3455dff2d16b8921b4b08437) () Constructor, OK state. [More...](classansys_1_1_project_1_1_error.xhtml#aa79933ec3455dff2d16b8921b4b08437)  
  [Error](classansys_1_1_project_1_1_error.xhtml#a50adf64e12defa7ca09cc4203cb4b6b6) (const std::string &amp;pErrorStr) Constructor, [Error](classansys_1_1_project_1_1_error.xhtml "The return state / error value of a Project function call.") state with error message. [More...](classansys_1_1_project_1_1_error.xhtml#a50adf64e12defa7ca09cc4203cb4b6b6)  
 void [addError](classansys_1_1_project_1_1_error.xhtml#a520361ea2991e1dd2f9becee06ef957b) (const std::string &amp;pErrororStr) Add one error to the object. [More...](classansys_1_1_project_1_1_error.xhtml#a520361ea2991e1dd2f9becee06ef957b)  
 void [addWarning](classansys_1_1_project_1_1_error.xhtml#aa6886b4eedbd1147e63d8b78a81724ea) (const std::string &amp;pWarningStr) Add one warning to the object (a OK state is still OK) [More...](classansys_1_1_project_1_1_error.xhtml#aa6886b4eedbd1147e63d8b78a81724ea)  
 void [addInfo](classansys_1_1_project_1_1_error.xhtml#ad3ae7ed5b9f79328e1109bc6c1404d8f) (const std::string &amp;pInfoStr) Add one info mesage to the object (a OK state is still OK) [More...](classansys_1_1_project_1_1_error.xhtml#ad3ae7ed5b9f79328e1109bc6c1404d8f)  
 void [operator+=](classansys_1_1_project_1_1_error.xhtml#a649e9d72c052e39ef1dd965a5fb055df) (const [Error](classansys_1_1_project_1_1_error.xhtml) &amp;pObj) Appends all info/warning/error states. [More...](classansys_1_1_project_1_1_error.xhtml#a649e9d72c052e39ef1dd965a5fb055df)  
 bool [operator()](classansys_1_1_project_1_1_error.xhtml#ab5bbc62f94267c06b4fab49d7fa9eb04) () const Equivalent to [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.") [More...](classansys_1_1_project_1_1_error.xhtml#ab5bbc62f94267c06b4fab49d7fa9eb04)  
 bool [ok](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe) () const True if no error message. [More...](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe)  
 std::string [getErrorsString](classansys_1_1_project_1_1_error.xhtml#aee6b8e41b1555cc5d66782be6c45b969) () const All errors as a single string. [More...](classansys_1_1_project_1_1_error.xhtml#aee6b8e41b1555cc5d66782be6c45b969)  
 std::string [getAllString](classansys_1_1_project_1_1_error.xhtml#ab173a61ed17149a9f736c3a69e38f7f0) () const All messages as a single string. [More...](classansys_1_1_project_1_1_error.xhtml#ab173a61ed17149a9f736c3a69e38f7f0)  
 const std::vector&lt; std::string &gt; &amp; [getErrors](classansys_1_1_project_1_1_error.xhtml#a058f63dc1df3409d12cfac7be52b802f) () const All errors as a string vector. Empty if [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.") [More...](classansys_1_1_project_1_1_error.xhtml#a058f63dc1df3409d12cfac7be52b802f)  
 const std::vector&lt; std::string &gt; &amp; [getWarnings](classansys_1_1_project_1_1_error.xhtml#ae1fb76f0cec315c417e764e21ba36286) () const All warnings as a string vector. [More...](classansys_1_1_project_1_1_error.xhtml#ae1fb76f0cec315c417e764e21ba36286)  
 const std::vector&lt; std::string &gt; &amp; [getInfos](classansys_1_1_project_1_1_error.xhtml#a440e03a8b3c2808032a323cfdb29f07e) () const All info messages as a string vector. [More...](classansys_1_1_project_1_1_error.xhtml#a440e03a8b3c2808032a323cfdb29f07e)  
 <a id="details" name="details"></a>## Detailed Description

The return state / error value of a [Project](classansys_1_1_project_1_1_project.xhtml "Base class for Project API, also see SimProject.") function call.

The [Error](classansys_1_1_project_1_1_error.xhtml "The return state / error value of a Project function call.") object gathers the ok or error state of a project function call.

If there is no error [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.") returns true. A ok state might provide information (getInfo()) or warning (getWarning()) messages.

If there is an error ( [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.") returns false ) there is at least one error message.



## Constructor &amp; Destructor Documentation

<a id="aa79933ec3455dff2d16b8921b4b08437" name="aa79933ec3455dff2d16b8921b4b08437"></a>## [◆ ](#aa79933ec3455dff2d16b8921b4b08437)Error() \[1/2\]

 ansys::Project::Error::Error  ( ) 

Constructor, OK state.





<a id="a50adf64e12defa7ca09cc4203cb4b6b6" name="a50adf64e12defa7ca09cc4203cb4b6b6"></a>## [◆ ](#a50adf64e12defa7ca09cc4203cb4b6b6)Error() \[2/2\]

 ansys::Project::Error::Error  ( const std::string &amp;  *pErrorStr*) 

Constructor, [Error](classansys_1_1_project_1_1_error.xhtml "The return state / error value of a Project function call.") state with error message.





## Member Function Documentation

<a id="a520361ea2991e1dd2f9becee06ef957b" name="a520361ea2991e1dd2f9becee06ef957b"></a>## [◆ ](#a520361ea2991e1dd2f9becee06ef957b)addError()

 void ansys::Project::Error::addError  ( const std::string &amp;  *pErrororStr*) 

Add one error to the object.





<a id="ad3ae7ed5b9f79328e1109bc6c1404d8f" name="ad3ae7ed5b9f79328e1109bc6c1404d8f"></a>## [◆ ](#ad3ae7ed5b9f79328e1109bc6c1404d8f)addInfo()

 void ansys::Project::Error::addInfo  ( const std::string &amp;  *pInfoStr*) 

Add one info mesage to the object (a OK state is still OK)





<a id="aa6886b4eedbd1147e63d8b78a81724ea" name="aa6886b4eedbd1147e63d8b78a81724ea"></a>## [◆ ](#aa6886b4eedbd1147e63d8b78a81724ea)addWarning()

 void ansys::Project::Error::addWarning  ( const std::string &amp;  *pWarningStr*) 

Add one warning to the object (a OK state is still OK)





<a id="ab173a61ed17149a9f736c3a69e38f7f0" name="ab173a61ed17149a9f736c3a69e38f7f0"></a>## [◆ ](#ab173a61ed17149a9f736c3a69e38f7f0)getAllString()

 std::string ansys::Project::Error::getAllString  ( )  const

All messages as a single string.

Each type of messages as a separate line prefixed by the appropriate type ( [Error](classansys_1_1_project_1_1_error.xhtml "The return state / error value of a Project function call."): , Warning: , Information )





<a id="a058f63dc1df3409d12cfac7be52b802f" name="a058f63dc1df3409d12cfac7be52b802f"></a>## [◆ ](#a058f63dc1df3409d12cfac7be52b802f)getErrors()

 const std::vector&lt; std::string &gt; &amp; ansys::Project::Error::getErrors  ( )  const

All errors as a string vector. Empty if [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.")





<a id="aee6b8e41b1555cc5d66782be6c45b969" name="aee6b8e41b1555cc5d66782be6c45b969"></a>## [◆ ](#aee6b8e41b1555cc5d66782be6c45b969)getErrorsString()

 std::string ansys::Project::Error::getErrorsString  ( )  const

All errors as a single string.

All errors as a single string, with separate lines for each error. Empty string if [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.")





<a id="a440e03a8b3c2808032a323cfdb29f07e" name="a440e03a8b3c2808032a323cfdb29f07e"></a>## [◆ ](#a440e03a8b3c2808032a323cfdb29f07e)getInfos()

 const std::vector&lt; std::string &gt; &amp; ansys::Project::Error::getInfos  ( )  const

All info messages as a string vector.





<a id="ae1fb76f0cec315c417e764e21ba36286" name="ae1fb76f0cec315c417e764e21ba36286"></a>## [◆ ](#ae1fb76f0cec315c417e764e21ba36286)getWarnings()

 const std::vector&lt; std::string &gt; &amp; ansys::Project::Error::getWarnings  ( )  const

All warnings as a string vector.





<a id="a03ae4711dd85a12532457d9aa3983bfe" name="a03ae4711dd85a12532457d9aa3983bfe"></a>## [◆ ](#a03ae4711dd85a12532457d9aa3983bfe)ok()

 bool ansys::Project::Error::ok  ( )  const

True if no error message.

If false, there is at least one error message. If true, there might be information or warning messages





<a id="ab5bbc62f94267c06b4fab49d7fa9eb04" name="ab5bbc62f94267c06b4fab49d7fa9eb04"></a>## [◆ ](#ab5bbc62f94267c06b4fab49d7fa9eb04)operator()()

 bool ansys::Project::Error::operator()  ( )  const

Equivalent to [ok()](classansys_1_1_project_1_1_error.xhtml#a03ae4711dd85a12532457d9aa3983bfe "True if no error message.")





<a id="a649e9d72c052e39ef1dd965a5fb055df" name="a649e9d72c052e39ef1dd965a5fb055df"></a>## [◆ ](#a649e9d72c052e39ef1dd965a5fb055df)operator+=()

 void ansys::Project::Error::operator+=  ( const [Error](classansys_1_1_project_1_1_error.xhtml) &amp;  *pObj*) 

Appends all info/warning/error states.