Allow constructing BadRequest from std::string

This commit is contained in:
Martchus 2021-07-07 19:46:43 +02:00
parent b5ca815e4c
commit a2fbba9713
1 changed files with 7 additions and 1 deletions

View File

@ -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<std::pair<std::string_view, std::string_view>> &&params);
Url(const Request &request);