[collectd] [PATCH 3/6] php-collection/graph.php: Add missing error500() function

Bruno Prémont bonbons at linux-vserver.org
Sun Mar 1 22:19:49 CET 2009


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.

diff --git a/contrib/php-collection/graph.php b/contrib/php-collection/graph.php
--- 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))



More information about the collectd mailing list