Skip to content

Commit fbc3ff9

Browse files
committed
Suppress clang-tidy error on main functions
The main functions now catch all exceptions, but there is still the possibility that the logging of the error message throws again. Not much we can do about this.
1 parent ea0178e commit fbc3ff9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/gen/osm2pgsql-gen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ void genproc_t::run()
595595
}
596596
}
597597

598+
// NOLINTNEXTLINE(bugprone-exception-escape)
598599
int main(int argc, char *argv[])
599600
{
600601
try {

src/osm2pgsql.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ static void check_and_set_style(options_t *options)
348348
}
349349
}
350350

351+
// NOLINTNEXTLINE(bugprone-exception-escape)
351352
int main(int argc, char *argv[])
352353
{
353354
try {
@@ -404,6 +405,9 @@ int main(int argc, char *argv[])
404405
} catch (std::exception const &e) {
405406
log_error("{}", e.what());
406407
return 1;
408+
} catch (...) {
409+
log_error("Unknown exception.");
410+
return 1;
407411
}
408412

409413
return 0;

0 commit comments

Comments
 (0)