Builder class for constructing DiagnosticMsg objects.
More...
#include <ErrorHandling.hpp>
Builder class for constructing DiagnosticMsg objects.
Definition at line 151 of file ErrorHandling.hpp.
◆ addCallStackInfo()
Add the stack trace information about the error.
- Parameters
-
| stacktrace | stack trace information to add |
- Returns
- Reference to the current instance for method chaining.
◆ addContextInfo()
template<typename ... Args>
Adds one or more context elements to the error.
- Template Parameters
-
| Args | Variadic pack of compatible types (ErrorContext / DataContext) |
- Parameters
-
| args | List of context data structures. |
- Returns
- Reference to the current instance for method chaining.
Definition at line 198 of file ErrorHandling.hpp.
◆ addDetectionLocation()
Add where the detection occured.
- Parameters
-
| detectionLocation | The context where the diagnostic happoned |
- Returns
- The instance, for builder pattern.
◆ addRank()
Add a rank on which the error has been raised.
- Parameters
-
- Returns
- Reference to the current instance for method chaining.
◆ addSignal()
Add the signal to the DiagnosticMsg.
- the signal can be one of the main error signals.
- if the signal is SIGFPE, the nature of floating point error will be interpreted.
- Parameters
-
| sig | The signal, from ISO C99 or POSIX standard. |
| toEnd | adds the message to the end if true, at the start otherwise. |
- Returns
- The instance, for builder pattern.
◆ addToMsg() [1/2]
| DiagnosticMsgBuilder& geos::DiagnosticMsgBuilder::addToMsg |
( |
std::exception const & |
e, |
|
|
bool |
toEnd = false |
|
) |
| |
Append exception text to the message.
- Parameters
-
| e | The exception containing text to add |
| toEnd | If true, append at end; otherwise prepend |
- Returns
- Reference to the current instance for method chaining.
◆ addToMsg() [2/2]
| DiagnosticMsgBuilder& geos::DiagnosticMsgBuilder::addToMsg |
( |
std::string_view |
msg, |
|
|
bool |
toEnd = false |
|
) |
| |
Append text to the message.
- Parameters
-
| msg | The text to add |
| toEnd | If true, append at end; otherwise prepend |
- Returns
- Reference to the current instance for method chaining.
◆ getDiagnosticMsg()
◆ init()
Initialize a new DiagnosticMsg.
- Parameters
-
| msg | The DiagnosticMsg being built |
| msgType | Type of the diagnostic |
| msgContent | The message of the diagnostic. It can be completed afterward |
| rank | The rank on which the diagnostic occured |
- Returns
- DiagnosticMsgBuilder
◆ modify()
◆ setCause()
Set the cause of the error.
- Parameters
-
| cause | See documentation of m_cause. |
- Returns
- Reference to the current instance for method chaining.
◆ setCodeLocation()
Set the source code location values (file and line where the error is detected)
- Parameters
-
| msgFile | Name of the source file location to add |
| msgLine | Line of the source file location to add |
- Returns
- Reference to the current instance for method chaining.
◆ setType()
Set the type of the error, (amoung one of the MsgType)
- Parameters
-
| msgType | The type can be error, warning or exception |
- Returns
- Reference to the current instance for method chaining.
The documentation for this class was generated from the following file: