Gromacs
2024.4
|
Error message or error context text item.
Error messages for an exception are represented as a chain of ErrorMessage objects: the elements at the bottom of the chain (with no children) is the error message, and other elements are the context strings added.
Public Member Functions | |
ErrorMessage (const std::string &text) | |
Creates an error message object with the specified text. More... | |
bool | isContext () const |
Whether this object is a context string. | |
const std::string & | text () const |
Returns the text for this object. | |
const ErrorMessage & | child () const |
Returns the child object for a context object. More... | |
ErrorMessage | prependContext (const std::string &context) const |
Creates a new message object with context prepended. More... | |
|
explicit |
Creates an error message object with the specified text.
[in] | text | Text for the message. |
|
inline |
Returns the child object for a context object.
Must not be called if isContext() returns false.
ErrorMessage gmx::anonymous_namespace{exceptions.cpp}::ErrorMessage::prependContext | ( | const std::string & | context | ) | const |
Creates a new message object with context prepended.
[in] | context | Context string to add. |
context
as its text and this
as its child. std::bad_alloc | if out of memory. |