23#include <gz/utils/ImplPtr.hh>
24#include <sdf/config.hh>
32#pragma warning(disable: 4251)
208 const std::string &_filePath);
218 const std::string &_filePath,
int _lineNumber);
236 public: std::optional<std::string>
FilePath()
const;
254 public: std::optional<std::string>
XmlPath()
const;
265 public:
explicit operator bool()
const;
284 GZ_UTILS_IMPL_PTR(dataPtr)
std::string Message() const
Get the error message, which is a description of the error.
friend GZ_SDFORMAT_VISIBLE std::ostream & operator<<(std::ostream &_out, const sdf::Error &_err)
Output operator for an error.
std::optional< std::string > FilePath() const
Get the file path associated with this error.
Error(const ErrorCode _code, const std::string &_message, const std::string &_filePath, int _lineNumber)
Constructor.
bool operator==(const bool _value) const
Compare this Error to a boolean value.
void SetLineNumber(int _lineNumber)
Sets the line number that is associated with this error.
ErrorCode Code() const
Get the error code.
void SetFilePath(const std::string &_filePath)
Sets the file path that is associated with this error.
void SetMessage(const std::string &_message)
Sets the message associated with this error.
Error()
Default constructor.
void SetXmlPath(const std::string &_xmlPath)
Safe bool conversion.
Error(const ErrorCode _code, const std::string &_message, const std::string &_filePath)
Constructor.
std::optional< int > LineNumber() const
Get the line number associated with this error.
std::optional< std::string > XmlPath() const
Get the XPath-like trace that is associated with this error.
Error(const ErrorCode _code, const std::string &_message)
Constructor.
Internal namespace.
Definition Error.hh:290
void GZ_SDFORMAT_VISIBLE throwOrPrintError(sdf::Console::ConsoleStream &_out, const sdf::Error &_error)
Prints the error to _out or throw using SDF_ASSERT depending on the ErrorCode in _error.
ErrorCode
Set of error codes.
Definition Error.hh:48
@ XML_ERROR
Error at the XML level.
Definition Error.hh:188
@ WARNING
Generic warning saved as error due to WarningsPolicy config.
Definition Error.hh:171
@ VERSION_DEPRECATED
The provided version has been deprecated or it is pre-versioning.
Definition Error.hh:152
@ FRAME_ATTACHED_TO_CYCLE
The frame attached-to graph contains a cycle.
Definition Error.hh:127
@ LINK_INERTIA_INVALID
A link has invalid inertia.
Definition Error.hh:111
@ FRAME_ATTACHED_TO_GRAPH_ERROR
The frame attached-to graph has an internal error.
Definition Error.hh:130
@ POSE_RELATIVE_TO_GRAPH_ERROR
The pose relative-to graph has an internal error.
Definition Error.hh:140
@ ELEMENT_DEPRECATED
This error indicates that an SDF element is deprecated.
Definition Error.hh:82
@ URI_INVALID
A URI is invalid.
Definition Error.hh:93
@ DUPLICATE_NAME
A duplicate name was found for an element where unique names are required.
Definition Error.hh:57
@ CONVERSION_ERROR
SDF conversion generic error.
Definition Error.hh:178
@ JOINT_PARENT_LINK_INVALID
A joint has an invalid parent link.
Definition Error.hh:117
@ ATTRIBUTE_INVALID
This error indicates that an SDF attribute is invalid.
Definition Error.hh:66
@ URI_LOOKUP
A error occurred while trying to resolve a URI.
Definition Error.hh:96
@ ELEMENT_INVALID
This error indicates that an SDF element is invalid.
Definition Error.hh:79
@ DIRECTORY_NONEXISTANT
A filesystem directory does not exist.
Definition Error.hh:99
@ NESTED_MODELS_UNSUPPORTED
Indicates that a DOM object tried to read a nested model.
Definition Error.hh:108
@ PARSING_ERROR
Generic error during parsing.
Definition Error.hh:181
@ JOINT_AXIS_EXPRESSED_IN_INVALID
The joint axis expressed-in value does not match the name of an existing frame in the current scope.
Definition Error.hh:175
@ PARAMETER_ERROR
Generic error type for parameters (values of SDFormat elements or attributes).
Definition Error.hh:160
@ ELEMENT_MISSING
Indicates that a required SDF element is missing.
Definition Error.hh:76
@ STRING_READ
Indicates that reading an SDF string failed.
Definition Error.hh:146
@ FILE_READ
Indicates that reading an SDF file failed.
Definition Error.hh:53
@ JOINT_CHILD_LINK_INVALID
A joint has an invalid child link.
Definition Error.hh:114
@ JOINT_PARENT_SAME_AS_CHILD
A joint has the same link specified as parent and child.
Definition Error.hh:120
@ ELEMENT_INCORRECT_TYPE
Indicates that an incorrect SDF element type was encountered.
Definition Error.hh:87
@ MERGE_INCLUDE_UNSUPPORTED
Merge include is unsupported for the type of entity being included, or the custom parser does not sup...
Definition Error.hh:156
@ UNKNOWN_PARAMETER_TYPE
The specified parameter (values of SDFormat elements or attributes) type is unknown.
Definition Error.hh:164
@ POSE_RELATIVE_TO_INVALID
The pose relative-to value does not match the name of an existing frame in the current scope.
Definition Error.hh:134
@ MODEL_PLACEMENT_FRAME_INVALID
The specified placement frame is invalid.
Definition Error.hh:149
@ ATTRIBUTE_DEPRECATED
This error indicates that an SDF attribute is deprecated.
Definition Error.hh:69
@ NONE
No error.
Definition Error.hh:50
@ FRAME_ATTACHED_TO_INVALID
The frame attached-to value does not match the name of an existing frame in the current scope.
Definition Error.hh:124
@ FATAL_ERROR
Generic error to be thrown with SDF_ASSERT by the caller.
Definition Error.hh:168
@ POSE_RELATIVE_TO_CYCLE
The pose relative-to graph contains a cycle.
Definition Error.hh:137
@ ATTRIBUTE_MISSING
Indicates that a required SDF attribute is missing.
Definition Error.hh:63
@ JOINT_AXIS_MIMIC_INVALID
The joint axis mimic does not refer to a valid joint in the current scope.
Definition Error.hh:185
@ MODEL_WITHOUT_LINK
A model without a link.
Definition Error.hh:105
@ MODEL_CANONICAL_LINK_INVALID
A model with an invalid canonical link.
Definition Error.hh:102
@ ATTRIBUTE_INCORRECT_TYPE
Indicates an attribute was included that is not part of the sdf spec.
Definition Error.hh:73
@ ROTATION_SNAP_CONFIG_ERROR
The rotation snap config provided is not valid.
Definition Error.hh:143
@ ELEMENT_ERROR
Generic error type for Elements.
Definition Error.hh:90
@ RESERVED_NAME
A reserved name was used in an entity name attribute.
Definition Error.hh:60
namespace for Simulation Description Format parser
Definition Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:25