lib45d
45Drives C++ Library API Documentation
Exceptions.hpp
1 // -*- C++ -*-
2 /*
3  * Copyright (C) 2021 Joshua Boudreau <jboudreau@45drives.com>
4  *
5  * This file is part of lib45d.
6  *
7  * lib45d is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * lib45d is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with lib45d. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 
23 #include <45d/Exceptions.hpp>
24 
25 namespace ffd {
30  class ConfigException : public Exception {
31  public:
32  ConfigException(const std::string &what) noexcept : Exception(what) {}
33  };
34 
40  public:
41  NoConfigException(const std::string &what) noexcept : ConfigException(what) {}
42  };
43 
49  public:
50  MissingOptionException(const std::string &what) noexcept : ConfigException(what) {}
51  };
52 
59  public:
60  ConfigGuardException(const std::string &what) noexcept : ConfigException(what) {}
61  };
62 } // namespace ffd
ffd::NoConfigException
Throw this exception when the config file fails to open.
Definition: Exceptions.hpp:39
ffd
45Drives namespace
Definition: Bytes.hpp:27
ffd::MissingOptionException
Throw this exception when a config entry is missing.
Definition: Exceptions.hpp:48
ffd::Exception::what
const char * what(void) const noexcept
Return string containing explanation message.
Definition: Exceptions.hpp:44
ffd::ConfigException
General exception for all Config* related issues.
Definition: Exceptions.hpp:30
ffd::ConfigGuardException
Throw this exception when a ConfigGuard is constructed or get_from() is called when the config is alr...
Definition: Exceptions.hpp:58
ffd::Exception::Exception
Exception(const std::string &what, int err=0) noexcept
Construct a new Exception object.
Definition: Exceptions.hpp:38
ffd::Exception
Exceptions thrown by this library.
Definition: Exceptions.hpp:30