diff options
Diffstat (limited to 'admin_media.php')
| -rw-r--r-- | admin_media.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/admin_media.php b/admin_media.php index 9df3baaf5c..a22ac8c89c 100644 --- a/admin_media.php +++ b/admin_media.php @@ -59,6 +59,8 @@ if ($delete_file) { unlink($tmp); FlashMessages::addMessage(I18N::translate('The file %s has been deleted.', Html::filename($tmp)), 'success'); } catch (\ErrorException $ex) { + DebugBar::addThrowable($ex); + FlashMessages::addMessage(I18N::translate('The file %s could not be deleted.', Html::filename($tmp)) . '<hr><samp dir="ltr">' . $ex->getMessage() . '</samp>', 'danger'); } // Delete any corresponding thumbnail @@ -68,6 +70,8 @@ if ($delete_file) { unlink($tmp); FlashMessages::addMessage(I18N::translate('The file %s has been deleted.', Html::filename($tmp)), 'success'); } catch (\ErrorException $ex) { + DebugBar::addThrowable($ex); + FlashMessages::addMessage(I18N::translate('The file %s could not be deleted.', Html::filename($tmp)) . '<hr><samp dir="ltr">' . $ex->getMessage() . '</samp>', 'danger'); } } @@ -294,6 +298,8 @@ case 'load_json': $img = '<img src="data:' . $imgsize['mime'] . ';base64,' . base64_encode(file_get_contents($thumb_path)) . '" class="thumbnail" ' . $imgsize[3] . '" style="max-width:100px;height:auto;">'; } } catch (\ErrorException $ex) { + DebugBar::addThrowable($ex); + // Not an image, or not a valid image? $img = '-'; } @@ -492,11 +498,15 @@ function mediaFileInfo($media_folder, $media_path, $file) { $html .= '<dd>' . /* I18N: image dimensions, width × height */ I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1'])) . '</dd>'; } catch (\ErrorException $ex) { + DebugBar::addThrowable($ex); + // Not an image, or not a valid image? } $html .= '</dl>'; } catch (\ErrorException $ex) { + DebugBar::addThrowable($ex); + // Not a file? Not an image? } |
