File indexing completed on 2026-10-09 08:30:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsPlugins/Mille/MillePedeError.hpp"
0010
0011 #include <string>
0012
0013 namespace {
0014
0015 class MillePedeErrorCategory : public std::error_category {
0016 public:
0017
0018 const char* name() const noexcept final { return "MillePedeError"; }
0019
0020
0021 std::string message(int c) const final {
0022 using ActsPlugins::MillePedeError;
0023 using enum MillePedeError;
0024
0025 switch (static_cast<MillePedeError>(c)) {
0026 case InstallationNotFound:
0027 return "Installation of the 'pede' program was not found";
0028 case SteeringNotFound:
0029 return "Steering file for `pede` was not found at configured location";
0030 case SolverCrash:
0031 return "The solver crashed";
0032 case InvalidSolution:
0033 return "The solver encountered a serious error and found no valid "
0034 "solution";
0035 case SolutionNotReadable:
0036 return "The solution was not readable";
0037 case UnableToWriteSteering:
0038 return "The steering file could not be generated";
0039 default:
0040 return "unknown";
0041 }
0042 }
0043 };
0044
0045 }
0046
0047 std::error_code ActsPlugins::make_error_code(MillePedeError e) {
0048 static MillePedeErrorCategory c;
0049 return {static_cast<int>(e), c};
0050 }