fourdst::libcomposition v2.3.1
Robust atomic species information library
Loading...
Searching...
No Matches
exceptions_composition.h
Go to the documentation of this file.
1#pragma once
2
3#include <exception>
4#include <string>
5#include <utility>
6
15 class CompositionError : public std::exception {
16 protected:
20 std::string m_message;
21 public:
26 explicit CompositionError(std::string message)
27 : m_message(std::move(message)) {}
28
33 [[nodiscard]] const char* what() const noexcept override{
34 return m_message.c_str();
35 }
36 };
37
45
55
60 class SpeciesError : public std::exception {
61 protected:
62 std::string m_message;
63 public:
64 explicit SpeciesError(std::string message)
65 : m_message(std::move(message)) {}
66
67 [[nodiscard]] const char* what() const noexcept override {
68 return m_message.c_str();
69 }
70 };
71
78 class UnknownSymbolError final : public SpeciesError {
80 };
81
82}
CompositionError(std::string message)
Constructs a CompositionError with an error message.
const char * what() const noexcept override
Returns the error message.
Exception thrown when a composition is in an invalid or inconsistent state.
CompositionError(std::string message)
Constructs a CompositionError with an error message.
const char * what() const noexcept override
Exception thrown when an unknown symbol is encountered.
Exception thrown when a symbol is used that has not been registered.
CompositionError(std::string message)
Constructs a CompositionError with an error message.