You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created by elippmann on 2015-03-27 13:50:01 +00:00
Assignee: elippmann
Status: Resolved (closed on 2015-04-07 11:10:05 +00:00)
Target Version: 2.0.0-rc1
Last Update: 2015-04-07 11:10:05 +00:00 (in Redmine)
Controller actions and CLI commands may require mandatory parameters. Instead of writing custom code for each of them, we should introduce requiring mandatory parameters in our framework:
Action:
$host = $this->params->req('host');
Param:
public function req($name)
{
if ($this->has($name) && strlen(($value = $this->get($name))) > 0) {
return $value;
}
throw new MissingParameterException(...);
}
lib: Add MissingParameterException::getParameter and ::setParameter ...
... for getting/setting the name of the missing parameter which caused the exception.
refs #8886
This issue has been migrated from Redmine: https://dev.icinga.com/issues/8886
Created by elippmann on 2015-03-27 13:50:01 +00:00
Assignee: elippmann
Status: Resolved (closed on 2015-04-07 11:10:05 +00:00)
Target Version: 2.0.0-rc1
Last Update: 2015-04-07 11:10:05 +00:00 (in Redmine)
Controller actions and CLI commands may require mandatory parameters. Instead of writing custom code for each of them, we should introduce requiring mandatory parameters in our framework:
Action:
Param:
Web should respond with 400 (https://tools.ietf.org/html/rfc7231#section-6.5.1) and may include X-Status-Reason: Missing parameter $name.
Changesets
2015-04-07 08:48:37 +00:00 by elippmann 4d79549
2015-04-07 10:15:15 +00:00 by elippmann 0fc5801
2015-04-07 10:17:59 +00:00 by elippmann 93b1a35
2015-04-07 10:20:37 +00:00 by elippmann 002e793
2015-04-07 10:27:19 +00:00 by elippmann 25736cf
2015-04-07 11:06:43 +00:00 by elippmann 6b63f3d
Relations:
The text was updated successfully, but these errors were encountered: