Skip to content

Commit

Permalink
catch Exception -> Throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 12, 2021
1 parent bd321ac commit 0f4a99d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CodeCoverage/Generators/AbstractGenerator.php
Expand Up @@ -82,7 +82,7 @@ public function render(string $file = null): void
ob_start(function (string $buffer) use ($handle) { fwrite($handle, $buffer); }, 4096);
try {
$this->renderSelf();
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
ob_end_flush();
fclose($handle);
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Assert.php
Expand Up @@ -413,7 +413,7 @@ public static function error(callable $function, $expectedType, string $expected
try {
$function();
restore_error_handler();
} catch (\Exception $e) {
} catch (\Throwable $e) {
restore_error_handler();
throw $e;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/TestCase.php
Expand Up @@ -127,7 +127,7 @@ public function runTest(string $method, array $args = null): void
} else {
[$this, $method->getName()](...$params);
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
$this->handleErrors = false;
$this->silentTearDown();
throw $e;
Expand Down Expand Up @@ -187,7 +187,7 @@ private function silentTearDown(): void
set_error_handler(function () {});
try {
$this->tearDown();
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
restore_error_handler();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/TestHandler.php
Expand Up @@ -150,7 +150,7 @@ private function initiateDataProvider(Test $test, string $provider)
throw new \Exception("No records in data provider file '{$test->getFile()}'" . ($query ? " for query '$query'" : '') . '.');
}

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

Expand Down

0 comments on commit 0f4a99d

Please sign in to comment.