Document exceptions where they could occur.
This commit is contained in:
parent
7333fdf089
commit
d99520c2ea
|
@ -50,6 +50,11 @@ public:
|
|||
*
|
||||
* @param application_name The name of your application.
|
||||
* @param filename The filename to open.
|
||||
|
||||
* @throw std::ifstream::failure Could not read from file
|
||||
* @throw std::ofstream::failure Could not write to file
|
||||
* @throw nlohmann::detail::parse_error Could not parse file
|
||||
* @throw nlohmann::detail::type_error Setting not found / Wrong type
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
|
|
|
@ -50,6 +50,9 @@ public:
|
|||
* @param application_name The name of your application. Is appended to
|
||||
* all returned directories.
|
||||
*
|
||||
* @throw std::runtime_error Directory not found
|
||||
* @throw std::filesystem::filesystem_error Could not create directory
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
explicit Directories(const string_view application_name)
|
||||
|
|
|
@ -42,12 +42,7 @@ public:
|
|||
/*!
|
||||
* @brief Construct a FediPotato object.
|
||||
*
|
||||
* These exception could occur:
|
||||
* * `std::runtime_error` (Directory not found)
|
||||
* * `std::filesystem::filesystem_error` (Could not create directory)
|
||||
* * `std::ifstream::failure` (Could not read from file)
|
||||
* * `std::ofstream::failure` (Could not write to file)
|
||||
* * `nlohmann::detail::parse_error` (Could not parse file)
|
||||
* For possible exceptions see Directories and Config.
|
||||
*
|
||||
* @param application_name The name of your application. Influences the
|
||||
* file paths for all the data that is stored.
|
||||
|
@ -57,8 +52,7 @@ public:
|
|||
explicit FediPotato(const string_view application_name)
|
||||
: _application_name{application_name}
|
||||
, _config{application_name, "general.json"}
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//! Copy constructor
|
||||
FediPotato(const FediPotato &other) = default;
|
||||
|
|
Reference in New Issue