diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-04-23 12:37:36 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-04-23 12:37:36 +0200 |
| commit | a275d4591275c1a273c1c7b27565b808b253c6b9 (patch) | |
| tree | 71ad58d4479f680c8e61a411d5d7688d7487b5dd /src/apps | |
| parent | 52e0536a880d0be0496230f484ae63e47e661de7 (diff) | |
| download | PROJ-a275d4591275c1a273c1c7b27565b808b253c6b9.tar.gz PROJ-a275d4591275c1a273c1c7b27565b808b253c6b9.zip | |
projinfo: catch potential exception (master only, CID 193527)
Diffstat (limited to 'src/apps')
| -rw-r--r-- | src/apps/projinfo.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 404007e5..8b6acf54 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -1339,9 +1339,15 @@ int main(int argc, char **argv) { if (dumpDbStructure) { assert(dbContext); - const auto structure = dbContext->getDatabaseStructure(); - for (const auto &sql : structure) { - std::cout << sql << std::endl; + try { + const auto structure = dbContext->getDatabaseStructure(); + for (const auto &sql : structure) { + std::cout << sql << std::endl; + } + } catch (const std::exception &e) { + std::cerr << "ERROR: getDatabaseStructure() failed: " << e.what() + << std::endl; + std::exit(1); } } |
