File indexing completed on 2025-01-18 09:12:14
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsFatras/Kernel/detail/SimulationError.hpp"
0010
0011 #include <string>
0012
0013 namespace ActsFatras::detail {
0014 namespace {
0015
0016
0017 class SimulationErrorCategory final : public std::error_category {
0018 public:
0019 const char* name() const noexcept final { return "SimulationError"; }
0020 std::string message(int c) const final {
0021 switch (static_cast<SimulationError>(c)) {
0022 case SimulationError::eInvalidInputParticleId:
0023 return "Input particle id with non-zero generation or sub-particle";
0024 default:
0025 return "unknown";
0026 }
0027 }
0028 };
0029
0030 const SimulationErrorCategory s_simulatorErrorCategory;
0031
0032 }
0033
0034 std::error_code make_error_code(SimulationError e) {
0035 return {static_cast<int>(e), s_simulatorErrorCategory};
0036 }
0037
0038 }