fourdst::libcomposition v2.0.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
14 class CompositionError : public std::exception {
15 protected:
19 std::string m_message;
20 public:
25 explicit CompositionError(const std::string& message)
26 : m_message(std::move(message)) {}
27
32 const char* what() const noexcept override{
33 return m_message.c_str();
34 }
35 };
36
44
54
59 class SpeciesError : public std::exception {
60 protected:
61 std::string m_message;
62 public:
63 explicit SpeciesError(const std::string& message)
64 : m_message(std::move(message)) {}
65
66 const char* what() const noexcept override {
67 return m_message.c_str();
68 }
69 };
70
77 class UnknownSymbolError final : public SpeciesError {
79 };
80
81}
const char * what() const noexcept override
Returns the error message.
CompositionError(const std::string &message)
Constructs a CompositionError with an error message.
Exception thrown when a composition is in an invalid or inconsistent state.
CompositionError(const 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(const std::string &message)
Constructs a CompositionError with an error message.