summaryrefslogtreecommitdiff
path: root/mediafirewall.php
diff options
context:
space:
mode:
Diffstat (limited to 'mediafirewall.php')
-rw-r--r--mediafirewall.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/mediafirewall.php b/mediafirewall.php
index 1eb95bf510..6d16b48e8a 100644
--- a/mediafirewall.php
+++ b/mediafirewall.php
@@ -85,17 +85,27 @@ try {
$error_reporting = error_reporting(0);
$server->outputImage($media_file, $_GET);
error_reporting($error_reporting);
-} catch (SignatureException $e) {
+} catch (SignatureException $ex) {
+ DebugBar::addThrowable($ex);
+
FunctionsMedia::outputHttpStatusAsImage(403, 'Not allowed');
} catch (FileNotFoundException $ex) {
+ DebugBar::addThrowable($ex);
+
FunctionsMedia::outputHttpStatusAsImage(404, 'Not found');
} catch (NotReadableException $ex) {
+ DebugBar::addThrowable($ex);
+
FunctionsMedia::outputHttpStatusAsImage(500, 'Error');
Log::addMediaLog("Unable to read image from " . $media_file . "\n" . $ex->getMessage());
} catch (NotSupportedException $ex) {
+ DebugBar::addThrowable($ex);
+
FunctionsMedia::outputHttpStatusAsImage(500, 'Error');
Log::addMediaLog("Install php-gd or php-imagick to create thumbnails.\n" . $ex->getMessage());
} catch (ErrorException $ex) {
+ DebugBar::addThrowable($ex);
+
FunctionsMedia::outputHttpStatusAsImage(500, 'Error');
Log::addMediaLog("Unsable to create thumbnail from " . $media_file . "\n" . $ex->getMessage());
}