An encapsulation of an error return from an OMF call.
More...
#include <omferror.h>
|
| OMFError () |
| Constructors.
|
|
| OMFError (const std::string &json) |
|
| ~OMFError () |
| Destructor for the error class.
|
|
unsigned int | messageCount () |
|
std::string | getMessage (unsigned int offset) |
| Return the error message for the given message. More...
|
|
std::string | getEventReason (unsigned int offset) |
| Return the error reason for the given message. More...
|
|
std::string | getEventSeverity (unsigned int offset) |
| Get the event severity for a given message. More...
|
|
std::string | getEventExceptionType (unsigned int offset) |
| Get the event exception type for a given message. More...
|
|
std::string | getEventExceptionMessage (unsigned int offset) |
| Get the event exception message for a given message. More...
|
|
int | getHttpCode () |
| Return the most severe HTTP Code from all messages. More...
|
|
void | setFromHttpResponse (const std::string &json) |
| Parse error information from an OMF POST response JSON document. More...
|
|
bool | hasErrors () |
| The error report contains at least one error level event.
|
|
bool | hasMessages () |
| The error report contains at least one message.
|
|
bool | Log (const std::string &mainMessage, bool filterDuplicates=true) |
| Log all available messages. More...
|
|
An encapsulation of an error return from an OMF call.
The class parses the JSON response and gives access to portion of that JSON response.
◆ getEventExceptionMessage()
string OMFError::getEventExceptionMessage |
( |
unsigned int |
offset | ) |
|
Get the event exception message for a given message.
- Parameters
-
offset | The message to examine |
- Returns
- string The event exception message
◆ getEventExceptionType()
string OMFError::getEventExceptionType |
( |
unsigned int |
offset | ) |
|
Get the event exception type for a given message.
- Parameters
-
offset | The message to examine |
- Returns
- string The event exception type
◆ getEventReason()
string OMFError::getEventReason |
( |
unsigned int |
offset | ) |
|
Return the error reason for the given message.
- Parameters
-
offset | The error within the report to return |
- Returns
- string The event reason
◆ getEventSeverity()
string OMFError::getEventSeverity |
( |
unsigned int |
offset | ) |
|
Get the event severity for a given message.
- Parameters
-
offset | The message to examine |
- Returns
- string The event severity
◆ getHttpCode()
int OMFError::getHttpCode |
( |
| ) |
|
Return the most severe HTTP Code from all messages.
PI Web API HTTP Codes are usually the same within one HTTP response.
- Returns
- HTTP Code
◆ getMessage()
string OMFError::getMessage |
( |
unsigned int |
offset | ) |
|
Return the error message for the given message.
- Parameters
-
offset | The error within the report to return |
- Returns
- string The event message
◆ Log()
bool OMFError::Log |
( |
const std::string & |
mainMessage, |
|
|
bool |
filterDuplicates = true |
|
) |
| |
Log all available messages.
- Parameters
-
mainMessage | Top-level message when reporting an error |
filterDuplicates | If true, do not log duplicate messages |
- Returns
- True if OMFError object holds at least one message
◆ setFromHttpResponse()
void OMFError::setFromHttpResponse |
( |
const std::string & |
json | ) |
|
Parse error information from an OMF POST response JSON document.
- Parameters
-
json | JSON response document from an OMF POST |
The documentation for this class was generated from the following files:
- C/plugins/north/OMF/include/omferror.h
- C/plugins/north/OMF/OMFError.cpp