mirror of https://github.com/Icinga/icinga2.git
Merge pull request #10201 from Icinga/Validation-failed
Remove redundant "Validation failed" prefix from ValidationError exceptions
This commit is contained in:
commit
5f487aff1b
|
@ -35,7 +35,7 @@ void Command::Validate(int types, const ValidationUtils& utils)
|
||||||
Value argvalue = argdict->Get("value");
|
Value argvalue = argdict->Get("value");
|
||||||
|
|
||||||
if (argvalue.IsString() && !MacroProcessor::ValidateMacroString(argvalue))
|
if (argvalue.IsString() && !MacroProcessor::ValidateMacroString(argvalue))
|
||||||
BOOST_THROW_EXCEPTION(ValidationError(this, { "arguments", kv.first, "value" }, "Validation failed: Closing $ not found in macro format string '" + argvalue + "'."));
|
BOOST_THROW_EXCEPTION(ValidationError(this, { "arguments", kv.first, "value" }, "Closing $ not found in macro format string '" + argvalue + "'."));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argdict->Contains("set_if")) {
|
if (argdict->Contains("set_if")) {
|
||||||
|
|
|
@ -739,7 +739,7 @@ void Notification::Validate(int types, const ValidationUtils& utils)
|
||||||
Array::Ptr groups = GetUserGroupsRaw();
|
Array::Ptr groups = GetUserGroupsRaw();
|
||||||
|
|
||||||
if ((!users || users->GetLength() == 0) && (!groups || groups->GetLength() == 0))
|
if ((!users || users->GetLength() == 0) && (!groups || groups->GetLength() == 0))
|
||||||
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(), "Validation failed: No users/user_groups specified."));
|
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(), "No users/user_groups specified."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::ValidateStates(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils)
|
void Notification::ValidateStates(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils)
|
||||||
|
|
|
@ -48,14 +48,13 @@ void IcingaDB::Validate(int types, const ValidationUtils& utils)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetEnableTls() && GetCertPath().IsEmpty() != GetKeyPath().IsEmpty()) {
|
if (GetEnableTls() && GetCertPath().IsEmpty() != GetKeyPath().IsEmpty()) {
|
||||||
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(), "Validation failed: Either both a client certificate (cert_path) and its private key (key_path) or none of them must be given."));
|
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(), "Either both a client certificate (cert_path) and its private key (key_path) or none of them must be given."));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
InitEnvironmentId();
|
InitEnvironmentId();
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(),
|
BOOST_THROW_EXCEPTION(ValidationError(this, std::vector<String>(), e.what()));
|
||||||
String("Validation failed: ") + e.what()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue