diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-21 21:27:07 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-08-04 15:22:05 +0300 |
commit | dbb56f2986eefd0ffb1350ab1ff0cb47ad5e7918 (patch) | |
tree | 74591d23b4355d7f72898547b2fa7bd61c5f0318 /bpkg/diagnostics.hxx | |
parent | 6851f0c2d06e2b22ff376d8f0912d1e9d7893a89 (diff) |
Add --no-private-config option for pkg-build and --no-{host,build2}-config options for cfg-create
Diffstat (limited to 'bpkg/diagnostics.hxx')
-rw-r--r-- | bpkg/diagnostics.hxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bpkg/diagnostics.hxx b/bpkg/diagnostics.hxx index 925b080..04ede36 100644 --- a/bpkg/diagnostics.hxx +++ b/bpkg/diagnostics.hxx @@ -16,15 +16,27 @@ namespace bpkg { using butl::diag_record; - // Throw this exception to terminate the process. The handler should - // assume that the diagnostics has already been issued. + // Throw this exception to terminate the process potentially with a custom + // exit code. The handler should assume that suitable diagnostics has + // already been issued. // - class failed: public std::exception {}; + class failed: public std::exception + { + public: + uint16_t code; + + explicit + failed (uint16_t c = 1): code (c) {} + }; // As above but needs to be used for recoverable errors which are likely to // disappear on the command retry. // - class recoverable: public failed {}; + class recoverable: public failed + { + public: + recoverable (): failed (2) {} + }; // Print process commmand line. If the number of elements is specified // (or the second version is used), then it will print the piped multi- |