Skip to content

Commit

Permalink
Improved "Invalid layer name" error message to include the name
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Apr 25, 2024
1 parent 32cd89a commit 987095e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ Layer VectorDataSet::layer(int index)
Layer VectorDataSet::layer(const std::string& name)
{
assert(_ptr);
return Layer(check_pointer(_ptr->GetLayerByName(name.c_str()), "Invalid layer name"));
return Layer(check_pointer_msg_cb(_ptr->GetLayerByName(name.c_str()), [&]() { return fmt::format("Invalid layer name: {}", name); }));
}

bool VectorDataSet::layer_exists(const std::string& name) const noexcept
Expand Down

0 comments on commit 987095e

Please sign in to comment.