From a275d4591275c1a273c1c7b27565b808b253c6b9 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 23 Apr 2021 12:37:36 +0200 Subject: projinfo: catch potential exception (master only, CID 193527) --- src/apps/projinfo.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/apps') 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); } } -- cgit v1.2.3