From c634b6177e011be129f6c740b651d29307bc4c7e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 10 Jul 2018 09:29:32 +0200 Subject: lib/format.php: make error on unkown type more verbose --- lib/format.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'lib/format.php') diff --git a/lib/format.php b/lib/format.php index 8731eb0..6c18648 100644 --- a/lib/format.php +++ b/lib/format.php @@ -28,6 +28,26 @@ function export_as_requested($content) { ) ); } else { - throw_http_error(406,"Not Acceptable","Unknown output format."); + throw_http_error( + 406, + "Not Acceptable", + implode( + "
\n", + array_merge( + array( + "Unknown output format.", + "Accepted:" + ), + array_map( + function($type){ + return "" . $type . ""; + }, + array_keys( + $content + ) + ) + ) + ) + ); } } -- cgit v1.2.3-70-g09d2