From a2fbba9713cbd9f2d6250596888e42d63c448aab Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 7 Jul 2021 19:46:43 +0200 Subject: [PATCH] Allow constructing BadRequest from std::string --- librepomgr/webapi/params.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/librepomgr/webapi/params.h b/librepomgr/webapi/params.h index c21b7b5..b8f6a22 100644 --- a/librepomgr/webapi/params.h +++ b/librepomgr/webapi/params.h @@ -26,7 +26,8 @@ struct ServiceSetup; namespace WebAPI { struct LIBREPOMGR_EXPORT BadRequest : std::runtime_error { - BadRequest(const char *message); + explicit BadRequest(const char *message); + explicit BadRequest(const std::string &message); }; inline BadRequest::BadRequest(const char *message) @@ -34,6 +35,11 @@ inline BadRequest::BadRequest(const char *message) { } +inline BadRequest::BadRequest(const std::string &message) + : std::runtime_error(message) +{ +} + struct LIBREPOMGR_EXPORT Url { Url(std::string_view path, std::string_view hash, std::vector> &¶ms); Url(const Request &request);