Skip to content

Commit b399ba2

Browse files
committed
Improve UI for errors
1 parent ab8a3f2 commit b399ba2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Application.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Aws\Exception\CredentialsException;
66
use Bref\Cli\Cli\IO;
7+
use Bref\Cli\Cli\Styles;
78
use ErrorException;
89
use Exception;
910
use Symfony\Component\Console\Input\InputInterface;
@@ -46,6 +47,8 @@ public function doRun(InputInterface $input, OutputInterface $output): int
4647

4748
public function renderThrowable(Throwable $e, OutputInterface $output): void
4849
{
50+
IO::spinClear();
51+
4952
// Prettify Bref Cloud errors
5053
if ($e instanceof ClientException) {
5154
try {
@@ -70,6 +73,9 @@ public function renderThrowable(Throwable $e, OutputInterface $output): void
7073
return;
7174
}
7275

76+
if (! IO::isVerbose()) {
77+
IO::writeln(Styles::gray('verbose logs are available by running `bref previous-logs`'));
78+
}
7379
IO::error($e);
7480
}
7581

src/Cli/BrefSpinner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,6 @@ private function formatTime(int|float $secs): string
171171
// else show minutes
172172
$mins = (int) floor($secs / 60);
173173
$secs = (int) floor($secs % 60);
174-
return $mins . 'm ' . $secs . 's';
174+
return $mins . 'm' . $secs . 's';
175175
}
176176
}

0 commit comments

Comments
 (0)