diff --git a/lib/inc/drogon/HttpAppFramework.h b/lib/inc/drogon/HttpAppFramework.h index 59b54aa5..a8159f78 100644 --- a/lib/inc/drogon/HttpAppFramework.h +++ b/lib/inc/drogon/HttpAppFramework.h @@ -1532,7 +1532,7 @@ class DROGON_EXPORT HttpAppFramework : public trantor::NonCopyable /** * @brief handler will be called upon an exception escapes a request handler */ - virtual void setExceptionHandler(ExceptionHandler handler) = 0; + virtual HttpAppFramework &setExceptionHandler(ExceptionHandler handler) = 0; /** * @brief returns the excaption handler diff --git a/lib/src/HttpAppFrameworkImpl.h b/lib/src/HttpAppFrameworkImpl.h index ba7e4305..6f89d8a7 100644 --- a/lib/src/HttpAppFrameworkImpl.h +++ b/lib/src/HttpAppFrameworkImpl.h @@ -657,9 +657,10 @@ class HttpAppFrameworkImpl final : public HttpAppFramework return reusePort_; } - void setExceptionHandler(ExceptionHandler handler) override + HttpAppFramework &setExceptionHandler(ExceptionHandler handler) override { exceptionHandler_ = std::move(handler); + return *this; } const ExceptionHandler &getExceptionHandler() const override