> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ansys::Project::Error Class Reference

The return state / error value of a [Project](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_project) function call.

`#include "Error.hpp"`

## Public Member Functions

| Type | Name |
| - | - |
| | [Error](#aa79933ec3455dff2d16b8921b4b08437) () Constructor, OK state. |
| | [Error](#a50adf64e12defa7ca09cc4203cb4b6b6) (const std::string \&pErrorStr) Constructor, [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_error.md) state with error message. |
| void | [addError](#a520361ea2991e1dd2f9becee06ef957b) (const std::string \&pErrororStr) Add one error to the object. |
| void | [addWarning](#aa6886b4eedbd1147e63d8b78a81724ea) (const std::string \&pWarningStr) Add one warning to the object (a OK state is still OK) |
| void | [addInfo](#ad3ae7ed5b9f79328e1109bc6c1404d8f) (const std::string \&pInfoStr) Add one info mesage to the object (a OK state is still OK) |
| void | [operator+=](#a649e9d72c052e39ef1dd965a5fb055df) (const [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_error.md) \&pObj) Appends all info/warning/error states. |
| bool | [operator()](#ab5bbc62f94267c06b4fab49d7fa9eb04) () const Equivalent to [ok()](#a03ae4711dd85a12532457d9aa3983bfe) |
| bool | [ok](#a03ae4711dd85a12532457d9aa3983bfe) () const True if no error message. |
| std::string | [getErrorsString](#aee6b8e41b1555cc5d66782be6c45b969) () const All errors as a single string. |
| std::string | [getAllString](#ab173a61ed17149a9f736c3a69e38f7f0) () const All messages as a single string. |
| const std::vector\< std::string > & | [getErrors](#a058f63dc1df3409d12cfac7be52b802f) () const All errors as a string vector. Empty if [ok()](#a03ae4711dd85a12532457d9aa3983bfe) |
| const std::vector\< std::string > & | [getWarnings](#ae1fb76f0cec315c417e764e21ba36286) () const All warnings as a string vector. |
| const std::vector\< std::string > & | [getInfos](#a440e03a8b3c2808032a323cfdb29f07e) () const All info messages as a string vector. |

## Detailed Description

The return state / error value of a [Project](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_project) function call.

The [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_error.md) object gathers the ok or error state of a project function call.

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

If there is an error ( [ok()](#a03ae4711dd85a12532457d9aa3983bfe) returns false ) there is at least one error message.

## Constructor & Destructor Documentation

### Error() \[1/2]

```cpp theme={null}
ansys::Project::Error::Error()
```

Constructor, OK state.

### Error() \[2/2]

```cpp theme={null}
ansys::Project::Error::Error(const std::string & pErrorStr)
```

Constructor, [Error](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_error.md) state with error message.

## Member Function Documentation

### addError()

```cpp theme={null}
void ansys::Project::Error::addError(const std::string & pErrororStr)
```

Add one error to the object.

### addInfo()

```cpp theme={null}
void ansys::Project::Error::addInfo(const std::string & pInfoStr)
```

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

### addWarning()

```cpp theme={null}
void ansys::Project::Error::addWarning(const std::string & pWarningStr)
```

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

### getAllString()

```cpp theme={null}
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](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_error.md): , Warning: , Information )

### getErrors()

```cpp theme={null}
const std::vector< std::string > & ansys::Project::Error::getErrors() const
```

All errors as a string vector. Empty if [ok()](#a03ae4711dd85a12532457d9aa3983bfe)

### getErrorsString()

```cpp theme={null}
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()](#a03ae4711dd85a12532457d9aa3983bfe)

### getInfos()

```cpp theme={null}
const std::vector< std::string > & ansys::Project::Error::getInfos() const
```

All info messages as a string vector.

### getWarnings()

```cpp theme={null}
const std::vector< std::string > & ansys::Project::Error::getWarnings() const
```

All warnings as a string vector.

### ok()

```cpp theme={null}
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

### operator()()

```cpp theme={null}
bool ansys::Project::Error::operator()() const
```

Equivalent to [ok()](#a03ae4711dd85a12532457d9aa3983bfe)

### operator+=()

```cpp theme={null}
void ansys::Project::Error::operator+=(const Error & pObj)
```

Appends all info/warning/error states.
