Skip to content

Commit 0f4a99d

Browse files
committed
catch Exception -> Throwable
1 parent bd321ac commit 0f4a99d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/CodeCoverage/Generators/AbstractGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function render(string $file = null): void
8282
ob_start(function (string $buffer) use ($handle) { fwrite($handle, $buffer); }, 4096);
8383
try {
8484
$this->renderSelf();
85-
} catch (\Exception $e) {
85+
} catch (\Throwable $e) {
8686
}
8787
ob_end_flush();
8888
fclose($handle);

src/Framework/Assert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public static function error(callable $function, $expectedType, string $expected
413413
try {
414414
$function();
415415
restore_error_handler();
416-
} catch (\Exception $e) {
416+
} catch (\Throwable $e) {
417417
restore_error_handler();
418418
throw $e;
419419
}

src/Framework/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function runTest(string $method, array $args = null): void
127127
} else {
128128
[$this, $method->getName()](...$params);
129129
}
130-
} catch (\Exception $e) {
130+
} catch (\Throwable $e) {
131131
$this->handleErrors = false;
132132
$this->silentTearDown();
133133
throw $e;
@@ -187,7 +187,7 @@ private function silentTearDown(): void
187187
set_error_handler(function () {});
188188
try {
189189
$this->tearDown();
190-
} catch (\Exception $e) {
190+
} catch (\Throwable $e) {
191191
}
192192
restore_error_handler();
193193
}

src/Runner/TestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function initiateDataProvider(Test $test, string $provider)
150150
throw new \Exception("No records in data provider file '{$test->getFile()}'" . ($query ? " for query '$query'" : '') . '.');
151151
}
152152

153-
} catch (\Exception $e) {
153+
} catch (\Throwable $e) {
154154
return $test->withResult(empty($optional) ? Test::FAILED : Test::SKIPPED, $e->getMessage());
155155
}
156156

0 commit comments

Comments
 (0)