Skip to content

Commit 11aae60

Browse files
committed
Mark some cases NOLINT
clang-tidy throws bugprone-empty-catch, but in all these cases there is a good and documented reason for the empty catch.
1 parent 0198013 commit 11aae60

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

include/osmium/io/bzip2_compression.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace osmium {
195195
~Bzip2Compressor() noexcept override {
196196
try {
197197
close();
198-
} catch (...) {
198+
} catch (...) { // NOLINT(bugprone-empty-catch)
199199
// Ignore any exceptions because destructor must not throw.
200200
}
201201
}
@@ -269,7 +269,7 @@ namespace osmium {
269269
~Bzip2Decompressor() noexcept override {
270270
try {
271271
close();
272-
} catch (...) {
272+
} catch (...) { // NOLINT(bugprone-empty-catch)
273273
// Ignore any exceptions because destructor must not throw.
274274
}
275275
}
@@ -377,7 +377,7 @@ namespace osmium {
377377
~Bzip2BufferDecompressor() noexcept override {
378378
try {
379379
close();
380-
} catch (...) {
380+
} catch (...) { // NOLINT(bugprone-empty-catch)
381381
// Ignore any exceptions because destructor must not throw.
382382
}
383383
}

include/osmium/io/compression.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ namespace osmium {
246246
~NoCompressor() noexcept override {
247247
try {
248248
close();
249-
} catch (...) {
249+
} catch (...) { // NOLINT(bugprone-empty-catch)
250250
// Ignore any exceptions because destructor must not throw.
251251
}
252252
}
@@ -337,7 +337,7 @@ namespace osmium {
337337
~NoDecompressor() noexcept override {
338338
try {
339339
close();
340-
} catch (...) {
340+
} catch (...) { // NOLINT(bugprone-empty-catch)
341341
// Ignore any exceptions because destructor must not throw.
342342
}
343343
}

include/osmium/io/detail/queue_util.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ namespace osmium {
117117
~queue_wrapper() noexcept {
118118
try {
119119
shutdown();
120-
} catch (...) {
120+
} catch (...) { // NOLINT(bugprone-empty-catch)
121+
// Ignore any exceptions because destructor must not throw.
121122
}
122123
}
123124

include/osmium/io/gzip_compression.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ namespace osmium {
131131
~GzipCompressor() noexcept override {
132132
try {
133133
close();
134-
} catch (...) {
134+
} catch (...) { // NOLINT(bugprone-empty-catch)
135135
// Ignore any exceptions because destructor must not throw.
136136
}
137137
}
@@ -196,7 +196,7 @@ namespace osmium {
196196
if (!m_gzfile) {
197197
try {
198198
osmium::io::detail::reliable_close(fd);
199-
} catch (...) {
199+
} catch (...) { // NOLINT(bugprone-empty-catch)
200200
}
201201
throw gzip_error{"gzip error: read initialization failed"};
202202
}
@@ -211,7 +211,7 @@ namespace osmium {
211211
~GzipDecompressor() noexcept override {
212212
try {
213213
close();
214-
} catch (...) {
214+
} catch (...) { // NOLINT(bugprone-empty-catch)
215215
// Ignore any exceptions because destructor must not throw.
216216
}
217217
}
@@ -293,7 +293,7 @@ namespace osmium {
293293
~GzipBufferDecompressor() noexcept override {
294294
try {
295295
close();
296-
} catch (...) {
296+
} catch (...) { // NOLINT(bugprone-empty-catch)
297297
// Ignore any exceptions because destructor must not throw.
298298
}
299299
}

include/osmium/io/reader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ namespace osmium {
368368
~Reader() noexcept {
369369
try {
370370
close();
371-
} catch (...) {
371+
} catch (...) { // NOLINT(bugprone-empty-catch)
372372
// Ignore any exceptions because destructor must not throw.
373373
}
374374
}

include/osmium/io/writer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ namespace osmium {
308308
~Writer() noexcept {
309309
try {
310310
do_close();
311-
} catch (...) {
311+
} catch (...) { // NOLINT(bugprone-empty-catch)
312312
// Ignore any exceptions because destructor must not throw.
313313
}
314314
}

include/osmium/util/memory_mapping.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ namespace osmium {
228228
~MemoryMapping() noexcept {
229229
try {
230230
unmap();
231-
} catch (const std::system_error&) {
231+
} catch (const std::system_error&) { // NOLINT(bugprone-empty-catch)
232232
// Ignore any exceptions because destructor must not throw.
233233
}
234234
}
@@ -591,7 +591,7 @@ inline osmium::util::MemoryMapping::MemoryMapping(MemoryMapping&& other) noexcep
591591
inline osmium::util::MemoryMapping& osmium::util::MemoryMapping::operator=(osmium::util::MemoryMapping&& other) noexcept {
592592
try {
593593
unmap();
594-
} catch (const std::system_error&) {
594+
} catch (const std::system_error&) { // NOLINT(bugprone-empty-catch)
595595
// Ignore unmap error. It should never happen anyway and we can't do
596596
// anything about it here.
597597
}
@@ -761,7 +761,7 @@ inline osmium::util::MemoryMapping::MemoryMapping(MemoryMapping&& other) noexcep
761761
inline osmium::util::MemoryMapping& osmium::util::MemoryMapping::operator=(osmium::util::MemoryMapping&& other) noexcept {
762762
try {
763763
unmap();
764-
} catch (const std::system_error&) {
764+
} catch (const std::system_error&) { // NOLINT(bugprone-empty-catch)
765765
// Ignore unmap error. It should never happen anyway and we can't do
766766
// anything about it here.
767767
}

0 commit comments

Comments
 (0)