diff options
| author | Stefan Boberg <[email protected]> | 2021-09-12 13:42:23 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-12 13:42:23 +0200 |
| commit | 835a7d00a9da37b07cdf450899ac7fd0125b3320 (patch) | |
| tree | 8281fb3c085d4a8982b0455bcb28a0d6d0ee27d2 /zenhttp/include | |
| parent | Added some std::error_code helpers (diff) | |
| download | zen-835a7d00a9da37b07cdf450899ac7fd0125b3320.tar.xz zen-835a7d00a9da37b07cdf450899ac7fd0125b3320.zip | |
Some error handling improvements in zenhttp
Primarily replaces some exception usage with std::error_code
Diffstat (limited to 'zenhttp/include')
| -rw-r--r-- | zenhttp/include/zenhttp/httpserver.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/zenhttp/include/zenhttp/httpserver.h b/zenhttp/include/zenhttp/httpserver.h index 4267903ae..b73646dad 100644 --- a/zenhttp/include/zenhttp/httpserver.h +++ b/zenhttp/include/zenhttp/httpserver.h @@ -259,16 +259,15 @@ protected: ExtendableStringBuilder<256> m_QueryStringUtf8; }; -class HttpServerException : public std::exception +class HttpServerException : public std::system_error { public: - HttpServerException(const char* Message, uint32_t Error); + HttpServerException(std::string_view Message, std::error_code Error) : std::system_error(Error), m_What(Message) {} virtual const char* what() const override; -private: - uint32_t m_ErrorCode; - std::string m_Message; +protected: + std::string m_What; }; /** |