Page MenuHomePhabricator

D17800.id42808.diff
No OneTemporary

D17800.id42808.diff

diff --git a/src/workflow/ArcanistDownloadWorkflow.php b/src/workflow/ArcanistDownloadWorkflow.php
--- a/src/workflow/ArcanistDownloadWorkflow.php
+++ b/src/workflow/ArcanistDownloadWorkflow.php
@@ -83,6 +83,7 @@
$display_name = 'F'.$id;
$is_show = $this->show;
$save_as = $this->saveAs;
+ $path = null;
try {
$file = $conduit->callMethodSynchronous(
@@ -186,7 +187,7 @@
throw new Exception(
pht(
'Got HTTP %d status response, expected HTTP 200.',
- $status));
+ $status->getStatusCode()));
}
if (strlen($data)) {
@@ -232,6 +233,14 @@
return 0;
} catch (Exception $ex) {
+
+ // If we created an empty file, clean it up.
+ if (!$is_show) {
+ if ($path !== null) {
+ Filesystem::remove($path);
+ }
+ }
+
// If we fail for any reason, fall back to the older mechanism using
// "file.info" and "file.download".
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 4:27 PM (7 h, 59 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6918796
Default Alt Text
D17800.id42808.diff (984 B)

Event Timeline