C++ guide and API reference#
Include isaacsim/common/exceptions/Exceptions.hpp and link isaacsim::common-exceptions:
#include <isaacsim/common/exceptions/Exceptions.hpp>
using isaacsim::common::exceptions::PrimPathError;
using isaacsim::common::exceptions::IsaacSimException;
void validatePrimPath(const std::string& primPath)
{
if (!isValid(primPath))
{
throw PrimPathError(primPath);
}
}
try
{
validatePrimPath("/World/does_not_exist");
}
catch (const IsaacSimException& error)
{
// Handles PrimPathError, PrimPathStringError, AttributeNameError, ValueTypeError, and any future Isaac Sim
// exception.
}
IsaacSimException derives from std::exception, so catch (const std::exception&) also works. Each subclass
exposes accessors for the structured data used to build its what() message:
using isaacsim::common::exceptions::ValueTypeError;
try
{
throw ValueTypeError("scale", "float", "str");
}
catch (const ValueTypeError& error)
{
// error.getAttributeName() == "scale"
// error.getExpectedType() == "float"
// error.getActualType() == "str"
}
The declarations and Doxygen comments in Exceptions.hpp are the authoritative C++ reference.
API reference#
Fully qualified namespace: isaacsim::common::exceptions
-
namespace exceptions#
Classes Summary#
- AttributeNameError
Raised when a caller references an attribute name that does not exist or is not accepted.
- CudaRuntimeError
Raised when a CUDA runtime call fails.
- IsaacSimException
Common base class for every Isaac Sim exception.
- PrimPathError
Raised when a USD prim path refers to an invalid prim.
- PrimPathStringError
Raised when a string does not parse as a valid USD prim path.
- ValueTypeError
Raised when a value's type does not match the type expected for an attribute.