You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Commands/BundleCommand.php
+34-12Lines changed: 34 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
3
3
namespaceNative\Laravel\Commands;
4
4
5
+
useCarbon\CarbonInterface;
5
6
useIlluminate\Console\Command;
6
7
useIlluminate\Support\Facades\Http;
7
8
useIlluminate\Support\Number;
@@ -34,7 +35,7 @@ public function handle()
34
35
}
35
36
36
37
if (! $this->checkAuthenticated()) {
37
-
$this->error('Invalid API token: check your ZEPHPYR_TOKEN on https://zephpyr.com/user/api-tokens');
38
+
$this->error('Invalid API token: check your ZEPHPYR_TOKEN on https://'.$this->hostname().'/user/api-tokens');
38
39
39
40
returnstatic::FAILURE;
40
41
}
@@ -67,9 +68,21 @@ public function handle()
67
68
68
69
$this->cleanUp();
69
70
71
+
returnstatic::FAILURE;
72
+
} elseif ($result->status() === 422) {
73
+
$this->error('Zephpyr returned the following error:');
74
+
$this->error(' → '.$result->json('message'));
75
+
$this->cleanUp();
76
+
77
+
returnstatic::FAILURE;
78
+
} elseif ($result->status() === 429) {
79
+
$this->error('Zephpyr has a rate limit on builds per hour. Please try again in '.now()->addSeconds(intval($result->header('Retry-After')))->diffForHumans(syntax: CarbonInterface::DIFF_ABSOLUTE).'.');
80
+
$this->cleanUp();
81
+
70
82
returnstatic::FAILURE;
71
83
} elseif ($result->failed()) {
72
-
$this->error("Failed to upload zip to Zephpyr. Error: {$result->status()}");
84
+
$this->error("Failed to upload zip to Zephpyr. Error code: {$result->status()}");
85
+
ray($result->body());
73
86
$this->cleanUp();
74
87
75
88
returnstatic::FAILURE;
@@ -92,9 +105,11 @@ protected function cleanUp(): void
0 commit comments