Skip to content

Commit 1ff8fea

Browse files
committed
Strip basepath off exception messages
1 parent 8fce591 commit 1ff8fea

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Application.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,19 @@ public function run(): int
220220
);
221221
return 1;
222222
} catch (\Throwable $e) {
223+
$message = $e->getMessage();
224+
$basePath = canonicalise_path($container->get('basePath'));
225+
226+
if (strpos($message, $basePath) !== null) {
227+
$message = str_replace($basePath, '', $message);
228+
}
229+
223230
$container
224231
->get(OutputInterface::class)
225232
->printError(
226233
sprintf(
227234
'%s',
228-
$e->getMessage()
235+
$message
229236
)
230237
);
231238
return 1;

0 commit comments

Comments
 (0)