From 2ee354c7a3a468fc4d9fee350403ef16ff05d17b Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 6 Mar 2020 06:41:55 +0100 Subject: [PATCH] More exception documentation. --- lib/include/account_mastodon.hpp | 25 +++++++++++++++++++++---- lib/include/config.hpp | 13 +++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/lib/include/account_mastodon.hpp b/lib/include/account_mastodon.hpp index 65c17e4..3e31afb 100644 --- a/lib/include/account_mastodon.hpp +++ b/lib/include/account_mastodon.hpp @@ -39,8 +39,15 @@ using std::thread; /*! * @brief Interact with an account using the Mastodon API. * - * @throw std::runtime_error No hashtag or list ID given. - * @throw std::logic_error Unhandled stream type. (Should never happen) + * @throw std::runtime_error No hashtag or list ID given. + * @throw std::logic_error Unhandled stream type. (Should never happen) + * @throw std::runtime_error Directory not found. + * @throw std::filesystem::filesystem_error Could not create directory. + * @throw std::ifstream::failure Could not read from file. + * @throw nlohmann::detail::parse_error Could not parse file. + * @throw nlohmann::detail::type_error Setting not found / Wrong type. + * @throw mastodonpp::CURLException libcurl error from + * [mastodonpp](https://doc.schlomp.space/mastodonpp/). * * @since 0.1.0 * @@ -70,6 +77,14 @@ public: * * For possible exceptions see Directories and Config. * + * @throw std::runtime_error Directory not found. + * @throw std::filesystem::filesystem_error Could not create directory. + * @throw std::ifstream::failure Could not read from file. + * @throw nlohmann::detail::parse_error Could not parse file. + * @throw nlohmann::detail::type_error Setting not found / Wrong type. + * @throw mastodonpp::CURLException libcurl error from + * [mastodonpp](https://doc.schlomp.space/mastodonpp/). + * * @since 0.1.0 */ MastodonAPI(string_view application_name, string_view account_name, @@ -97,8 +112,10 @@ public: * @param type What to stream. * @param id The hashtag or list id. * - * @throw std::runtime_error hashtag or list ID given. - * @throw std::logic_error Unhandled stream type. (Should never happen) + * @throw std::runtime_error hashtag or list ID given. + * @throw std::logic_error Unhandled stream type. (Should never happen) + * @throw mastodonpp::CURLException libcurl error from [mastodonpp] + * (https://doc.schlomp.space/mastodonpp/). * * @since 0.1.0 */ diff --git a/lib/include/config.hpp b/lib/include/config.hpp index 43a1c2c..5e4607c 100644 --- a/lib/include/config.hpp +++ b/lib/include/config.hpp @@ -40,10 +40,12 @@ using std::string_view; /*! * @brief Read and write the configuration. * - * @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. + * @throw std::runtime_error Directory not found. + * @throw std::filesystem::filesystem_error Could not create directory. + * @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 * @@ -58,6 +60,9 @@ public: * @param application_name The name of your application. * @param filename The filename to open. * + * @throw std::runtime_error Directory not found. + * @throw std::filesystem::filesystem_error Could not create directory. + * * @since 0.1.0 */ explicit Config(const string_view application_name,