From 131903c607cf8aad2a1cf61c198bc1aa06c0450d Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 12 Jun 2017 23:00:32 +0100 Subject: [PATCH] Rename TawashiException to just Exception. It's in tawashi namespace already. --- src/kamokan_impl/submit_paste_response.cpp | 6 +++--- src/tawashi/cgi_env.cpp | 2 +- src/tawashi/cgi_post.cpp | 2 +- src/tawashi/cgi_post.hpp | 2 +- src/tawashi/tawashi_exception.cpp | 4 ++-- src/tawashi/tawashi_exception.hpp | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/kamokan_impl/submit_paste_response.cpp b/src/kamokan_impl/submit_paste_response.cpp index 338d9b4..1f03fec 100644 --- a/src/kamokan_impl/submit_paste_response.cpp +++ b/src/kamokan_impl/submit_paste_response.cpp @@ -35,10 +35,10 @@ namespace kamokan { const char g_language_key[] = "lang"; const char g_duration_key[] = "ttl"; - class MissingPostVarError : public tawashi::TawashiException { + class MissingPostVarError : public tawashi::Exception { public: explicit MissingPostVarError(const boost::string_view& parKey) : - TawashiException( + tawashi::Exception( tawashi::ErrorReasons::MissingPostVariable, "Error retrieving POST variable \"" + std::string(parKey.begin(), parKey.end()) + "\"" ) @@ -118,7 +118,7 @@ namespace kamokan { ); return make_error_redirect(ErrorReasons::UnsupportedContentType); } - catch (const tawashi::TawashiException& e) { + catch (const tawashi::Exception& e) { statuslog->error(e.what()); return make_error_redirect(e.reason()); } diff --git a/src/tawashi/cgi_env.cpp b/src/tawashi/cgi_env.cpp index 89016f7..c2db0df 100644 --- a/src/tawashi/cgi_env.cpp +++ b/src/tawashi/cgi_env.cpp @@ -130,7 +130,7 @@ namespace cgi { std::string err_msg = "Parsing failed at position " + std::to_string(parsed_chars) + " for input \"" + content_type + "\""; - throw TawashiException(ErrorReasons::InvalidContentType, boost::string_view(err_msg)); + throw Exception(ErrorReasons::InvalidContentType, boost::string_view(err_msg)); } } } diff --git a/src/tawashi/cgi_post.cpp b/src/tawashi/cgi_post.cpp index 35c90ba..b62f008 100644 --- a/src/tawashi/cgi_post.cpp +++ b/src/tawashi/cgi_post.cpp @@ -33,7 +33,7 @@ namespace tawashi { UnsupportedContentTypeException::UnsupportedContentTypeException (const boost::string_view& parMessage) : - TawashiException(ErrorReasons::UnsupportedContentType, parMessage) + Exception(ErrorReasons::UnsupportedContentType, parMessage) { } diff --git a/src/tawashi/cgi_post.hpp b/src/tawashi/cgi_post.hpp index b7f68dc..e9fc44a 100644 --- a/src/tawashi/cgi_post.hpp +++ b/src/tawashi/cgi_post.hpp @@ -24,7 +24,7 @@ #include namespace tawashi { - class UnsupportedContentTypeException : public TawashiException { + class UnsupportedContentTypeException : public Exception { public: explicit UnsupportedContentTypeException (const boost::string_view& parMessage); }; diff --git a/src/tawashi/tawashi_exception.cpp b/src/tawashi/tawashi_exception.cpp index 09c2c2f..6255ffb 100644 --- a/src/tawashi/tawashi_exception.cpp +++ b/src/tawashi/tawashi_exception.cpp @@ -27,11 +27,11 @@ namespace tawashi { } } //unnamed namespace - TawashiException::TawashiException (ErrorReasons parReason, const boost::string_view& parMessage) : + Exception::Exception (ErrorReasons parReason, const boost::string_view& parMessage) : std::runtime_error(compose_err_message(parReason, parMessage)), m_reason(parReason) { } - TawashiException::~TawashiException() noexcept = default; + Exception::~Exception() noexcept = default; } //namespace tawashi diff --git a/src/tawashi/tawashi_exception.hpp b/src/tawashi/tawashi_exception.hpp index 1845880..0a3c6fa 100644 --- a/src/tawashi/tawashi_exception.hpp +++ b/src/tawashi/tawashi_exception.hpp @@ -22,10 +22,10 @@ #include namespace tawashi { - class TawashiException : public std::runtime_error { + class Exception : public std::runtime_error { public: - TawashiException (ErrorReasons parReason, const boost::string_view& parMessage); - ~TawashiException() noexcept; + Exception (ErrorReasons parReason, const boost::string_view& parMessage); + ~Exception() noexcept; ErrorReasons reason() const { return m_reason; }