]> khamidou — GitHub mirrors - arcanist.git/commitdiff
When a file upload fails during "arc diff", show why
authorepriestley <git@epriestley.com>
Wed, 12 Jun 2013 12:50:08 +0000 (05:50 -0700)
committerepriestley <git@epriestley.com>
Wed, 12 Jun 2013 12:50:08 +0000 (05:50 -0700)
Summary: We currently swallow the exception message, but this isn't useful. Fixes T3354.

Test Plan:
  $ arc diff HEAD^ --conduit-uri=http://local.aphront.com:8080/ --only
  Uploading 1 files...
  Failed to upload new binary 'large.png'.

  [HTTP/500] Internal Server Error
  As received by the server, this request had a nonzero content length but no POST data.

  Normally, this indicates that it exceeds the 'post_max_size' setting in the PHP configuration on the server. Increase the 'post_max_size' setting or reduce the size of the request.

  Request size according to 'Content-Length' was '2093052', 'post_max_size' is set to '100K'.

      Continue? [Y/n]

Reviewers: jamesr, chad

Reviewed By: chad

CC: aran
Maniphest Tasks: T3354

Differential Revision: https://secure.phabricator.com/D6186

src/workflow/ArcanistDiffWorkflow.php

index 13f5488195193d2eea37d50465564d8bf0371fca..84f29b7b514b2c30975fadfde549d32d02023528 100644 (file)
@@ -2539,7 +2539,8 @@ EOTEXT
         $change->setMetadata("{$type}:binary-phid", $phid);
         echo pht("Uploaded '%s' (%s).", $name, $type)."\n";
       } catch (Exception $e) {
-        echo "Failed to upload {$type} binary '{$name}'.\n";
+        echo "Failed to upload {$type} binary '{$name}'.\n\n";
+        echo $e->getMessage()."\n";
         if (!phutil_console_confirm('Continue?', $default_no = false)) {
           throw new ArcanistUsageException(
             'Aborted due to file upload failure. You can use --skip-binaries '.