Skip to content
Snippets Groups Projects

algo: Raise error if only one of output-file and output-type is specified.

Merged Felix Weiglhofer requested to merge fweig/cbmroot:output-flags into master
3 files
+ 22
13
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 8
6
@@ -5,18 +5,20 @@
#define CBM_ALGO_BASE_EXCEPTIONS_H
#include <exception>
#include <string_view>
#include <fmt/format.h>
namespace cbm::algo
{
/**
* @brief Base class for exceptions
* @brief Base class for exceptions.
*
* @note Should not be thrown directly. Use one of the derived classes instead.
*/
class Exception : public std::runtime_error {
public:
struct Exception : std::runtime_error {
template<typename... Args>
Exception(const char* fmt, Args&&... args) : std::runtime_error(fmt::format(fmt, std::forward<Args>(args)...))
Exception(std::string_view fmt, Args&&... args) : std::runtime_error(fmt::format(fmt, std::forward<Args>(args)...))
{
}
};
@@ -24,7 +26,7 @@ namespace cbm::algo
/**
* @brief Indicates an unrecoverable error. Should tear down the process.
*/
class FatalError : public Exception {
struct FatalError : Exception {
using Exception::Exception;
};
@@ -32,7 +34,7 @@ namespace cbm::algo
* Indicates an error during timeslice processing. Timeslice will be discarded.
* Processing can continue with new timeslice.
*/
class ProcessingError : public Exception {
struct ProcessingError : Exception {
using Exception::Exception;
};
Loading