Improve error messages when hitting PHP file upload issues

Summary: See T429. When you hit certain errors, you get less-than-helpful
messages like "upload error 3". Instead, produce human-readable errors.
Test Plan: Simulated errors, verified user receives decent error messages.
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran, startupguy
CC: aran
Differential Revision: 816
This commit is contained in:
epriestley
2011-08-16 12:37:50 -07:00
parent ec0d91a3ff
commit 735847865c
5 changed files with 58 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ class PhabricatorFile extends PhabricatorFileDAO {
$err = idx($spec, 'error');
if ($err) {
throw new Exception("File upload failed with error '{$err}'.");
throw new PhabricatorFileUploadException($err);
}
$tmp_name = idx($spec, 'tmp_name');