mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-19 01:07:00 -04:00
chore: use DWARFS_PANIC for code that should never be reached
This commit is contained in:
parent
e8e2323eea
commit
99d375e740
@ -93,6 +93,9 @@ class basic_worker_group final : public worker_group::impl, private Policy {
|
||||
try {
|
||||
stop();
|
||||
} catch (...) {
|
||||
DWARFS_PANIC(
|
||||
fmt::format("exception thrown in worker group destructor: {}",
|
||||
exception_str(std::current_exception())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <dwarfs/error.h>
|
||||
|
||||
#include <dwarfs/writer/internal/chmod_transformer.h>
|
||||
|
||||
namespace dwarfs::writer::internal {
|
||||
@ -173,6 +175,9 @@ chmod_transformer_::chmod_transformer_(std::string_view spec, mode_type umask)
|
||||
case 'o':
|
||||
bits = kAllOtherBits;
|
||||
break;
|
||||
default:
|
||||
DWARFS_PANIC("internal error: invalid ugo in mode spec");
|
||||
break;
|
||||
}
|
||||
|
||||
modifiers_.push_back(
|
||||
@ -330,6 +335,10 @@ chmod_transformer_::transform(mode_type mode, bool isdir) const {
|
||||
case '-':
|
||||
mode &= ~bits;
|
||||
break;
|
||||
|
||||
default:
|
||||
DWARFS_PANIC("internal error: invalid operator in modifier");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <folly/portability/Windows.h>
|
||||
#include <folly/system/ThreadName.h>
|
||||
|
||||
#include <dwarfs/error.h>
|
||||
#include <dwarfs/util.h>
|
||||
#include <dwarfs/writer/writer_progress.h>
|
||||
|
||||
#include <dwarfs/writer/internal/progress.h>
|
||||
@ -62,6 +64,9 @@ writer_progress::~writer_progress() noexcept {
|
||||
cond_.notify_all();
|
||||
thread_.join();
|
||||
} catch (...) {
|
||||
DWARFS_PANIC(
|
||||
fmt::format("exception thrown in writer_progress destructor: {}",
|
||||
exception_str(std::current_exception())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user