Dispatches internally to return the message associated with this error.
| 161 | |
| 162 | /// Dispatches internally to return the message associated with this error. |
| 163 | std::string message() const { |
| 164 | if (const auto *trap = std::get_if<Trap>(&data)) { |
| 165 | return trap->message(); |
| 166 | } |
| 167 | if (const auto *error = std::get_if<Error>(&data)) { |
| 168 | return std::string(error->message()); |
| 169 | } |
| 170 | std::abort(); |
| 171 | } |
| 172 | }; |
| 173 | |
| 174 | /// Result used by functions which can fail because of invariants being violated |