| 59 | { |
| 60 | |
| 61 | Json formatError( |
| 62 | Error::Type _type, |
| 63 | std::string const& _component, |
| 64 | std::string const& _message, |
| 65 | std::string const& _formattedMessage = "", |
| 66 | Json const& _sourceLocation = Json(), |
| 67 | Json const& _secondarySourceLocation = Json() |
| 68 | ) |
| 69 | { |
| 70 | Json error; |
| 71 | error["type"] = Error::formatErrorType(_type); |
| 72 | error["component"] = _component; |
| 73 | error["severity"] = Error::formatErrorSeverityLowercase(Error::errorSeverity(_type)); |
| 74 | error["message"] = _message; |
| 75 | error["formattedMessage"] = (_formattedMessage.length() > 0) ? _formattedMessage : _message; |
| 76 | if (_sourceLocation.is_object()) |
| 77 | error["sourceLocation"] = _sourceLocation; |
| 78 | if (_secondarySourceLocation.is_array()) |
| 79 | error["secondarySourceLocations"] = _secondarySourceLocation; |
| 80 | return error; |
| 81 | } |
| 82 | |
| 83 | Json formatFatalError(Error::Type _type, std::string const& _message) |
| 84 | { |
no test coverage detected