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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user