From 6b20a9fa8d95ccf1de169ae6ddabebefabda5629 Mon Sep 17 00:00:00 2001 From: Muhammad <73486659+Mis1eader-dev@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:43:56 +0300 Subject: [PATCH] Return `HttpAppFramework` by `setExceptionHandler` (#1866) --- lib/inc/drogon/HttpAppFramework.h | 2 +- lib/src/HttpAppFrameworkImpl.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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