Skip to content

Commit 01a36dd

Browse files
committed
Use PINOCCHIO_THROW_PRETTY rather than plain exception
1 parent ba4a054 commit 01a36dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/parsers/mjcf/mjcf-graph.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,20 +600,23 @@ namespace pinocchio
600600
auto vertex = el.get_optional<std::string>("<xmlattr>.vertex");
601601
if (!vertex)
602602
{
603-
throw std::invalid_argument("Only meshes with files/vertices are supported");
603+
PINOCCHIO_THROW_PRETTY(
604+
std::invalid_argument, "Only meshes with files/vertices are supported.")
604605
}
605606

606607
auto name = el.get_optional<std::string>("<xmlattr>.name");
607608
if (!name)
608609
{
609-
throw std::invalid_argument("Mesh with vertices without a name is not supported");
610+
PINOCCHIO_THROW_PRETTY(
611+
std::invalid_argument, "Mesh with vertices without a name is not supported");
610612
}
611613

612614
// Parse and validate vertices
613615
Eigen::VectorXd meshVertices = internal::getUnknownSizeVectorFromStream(*vertex);
614616
if (meshVertices.size() % 3 != 0)
615617
{
616-
throw std::invalid_argument("Number of vertices is not a multiple of 3");
618+
PINOCCHIO_THROW_PRETTY(
619+
std::invalid_argument, "Number of vertices is not a multiple of 3");
617620
}
618621

619622
// Convert to 3D vertex matrix

0 commit comments

Comments
 (0)