From a89c5943d84d1a2d481f03d17c55696ca1b1847c Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 8 Nov 2011 11:02:04 +0000 Subject: [PATCH] error details when the file copy fails --- core/imageboard.pack.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 249b1b2f..0b2c89b8 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -972,7 +972,8 @@ function move_upload_to_archive($event) { $target = warehouse_path("images", $event->hash); if(!file_exists(dirname($target))) mkdir(dirname($target), 0755, true); if(!@copy($event->tmpname, $target)) { - throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target)"); + $errors = error_get_last(); // note: requires php 5.2 + throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target): {$errors['type']} / {$errors['message']}"); return false; } return true;