1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-12-27 21:35:41 +00:00

Rename TawashiException to just Exception.

It's in tawashi namespace already.
This commit is contained in:
King_DuckZ 2017-06-12 23:00:32 +01:00
parent e5f7f60e8b
commit 131903c607
6 changed files with 11 additions and 11 deletions

View file

@ -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());
}

View file

@ -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));
}
}
}

View file

@ -33,7 +33,7 @@
namespace tawashi {
UnsupportedContentTypeException::UnsupportedContentTypeException (const boost::string_view& parMessage) :
TawashiException(ErrorReasons::UnsupportedContentType, parMessage)
Exception(ErrorReasons::UnsupportedContentType, parMessage)
{
}

View file

@ -24,7 +24,7 @@
#include <cstddef>
namespace tawashi {
class UnsupportedContentTypeException : public TawashiException {
class UnsupportedContentTypeException : public Exception {
public:
explicit UnsupportedContentTypeException (const boost::string_view& parMessage);
};

View file

@ -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

View file

@ -22,10 +22,10 @@
#include <boost/utility/string_view.hpp>
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; }