Skip to content

Commit 314367a

Browse files
committed
fix: don't catch non-errors in exception handlers
1 parent c99ce30 commit 314367a

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

packages/console/src/Commands/AboutCommand.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ private function writeFormattedInsights(): void
4949

5050
$this->console->header($provider->name);
5151

52-
try {
53-
foreach ($provider->getInsights() as $key => $value) {
54-
$this->console->keyValue($key, $this->formatInsight($value));
55-
}
56-
} catch (\Throwable $th) {
57-
$this->console->error('Failed to get insights: ' . $th->getMessage());
52+
foreach ($provider->getInsights() as $key => $value) {
53+
$this->console->keyValue($key, $this->formatInsight($value));
5854
}
5955
}
6056
}
@@ -67,13 +63,10 @@ private function writeInsightsAsJson(): void
6763
/** @var InsightsProvider $provider */
6864
$provider = $this->container->get($class);
6965

70-
try {
71-
$json[Str\to_snake_case($provider->name)] = Arr\map_with_keys(
72-
array: $provider->getInsights(),
73-
map: fn (mixed $value, string $key) => yield Str\to_snake_case($key) => $this->rawInsight($value),
74-
);
75-
} catch (\Throwable) {
76-
}
66+
$json[Str\to_snake_case($provider->name)] = Arr\map_with_keys(
67+
array: $provider->getInsights(),
68+
map: fn (mixed $value, string $key) => yield Str\to_snake_case($key) => $this->rawInsight($value),
69+
);
7770
}
7871

7972
$this->console->writeRaw(Json\encode($json));

packages/core/src/FrameworkKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function registerExceptionHandler(): self
230230
filename: $filename,
231231
line: $line,
232232
),
233-
));
233+
), error_levels: E_ERROR);
234234

235235
return $this;
236236
}

0 commit comments

Comments
 (0)