From: Bruno Prémont Date: Sun, 1 Mar 2009 21:19:49 +0000 (+0100) Subject: php-collection/graph.php: Add missing error500() function X-Git-Tag: collectd-4.6.2~5^2~11^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=177f4357d29d8a488686fd92da3acd5ef2d9b10b;p=collectd.git php-collection/graph.php: Add missing error500() function php-collection/graph.php: Add missing error500() function When a call to rrdtool fails or some other internal error occurs a HTTP error with code 500 and matching error image should be returned, added the missing error500() function which does this the same way as error404() and error400() functions. Signed-off-by: Florian Forster --- diff --git a/contrib/php-collection/graph.php b/contrib/php-collection/graph.php index e5365768..17749e06 100644 --- a/contrib/php-collection/graph.php +++ b/contrib/php-collection/graph.php @@ -112,6 +112,13 @@ function error400($title, $msg) { return error(400, "Bad request", $title, $msg); } +/** + * Incomplete / invalid request + */ +function error500($title, $msg) { + return error(500, "Internal error", $title, $msg); +} + // Process input arguments $host = read_var('host', $_GET, null); if (is_null($host))