Fixed regression on ID parameter parsing
This commit is contained in:
@@ -40,10 +40,8 @@ namespace API::Subsonic
|
|||||||
for (const std::string& param : it->second)
|
for (const std::string& param : it->second)
|
||||||
{
|
{
|
||||||
auto value {StringUtils::readAs<T>(param)};
|
auto value {StringUtils::readAs<T>(param)};
|
||||||
if (!value)
|
if (value)
|
||||||
throw BadParameterFormatGenericError {paramName};
|
res.emplace_back(std::move(*value));
|
||||||
|
|
||||||
res.emplace_back(std::move(*value));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -178,17 +178,6 @@ class BadParameterGenericError : public GenericError
|
|||||||
const std::string _parameterName;
|
const std::string _parameterName;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BadParameterFormatGenericError : public GenericError
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BadParameterFormatGenericError(const std::string& parameterName) : _parameterName {parameterName} {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string getMessage() const override { return "Parameter '" + _parameterName + "': bad format"; }
|
|
||||||
|
|
||||||
const std::string _parameterName;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Response
|
class Response
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user