Skip to content

Commit de763ff

Browse files
author
Chris Hulton
authored
Fixes exception bubbling for php7 (#39)
Rescues `Throwable` which includes `Exception` and php7 `Error` objects.
1 parent 403a58e commit de763ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Runner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function run($files)
119119
}
120120

121121
return $resultFile;
122-
} catch (Exception $e) {
122+
} catch (\Throwable $e) {
123123
error_log("Exception: " . $e->getMessage() . " in " . $e->getFile() . "\n" . $e->getTraceAsString());
124124
return $e;
125125
}

engine.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$results = $server->get_all_results();
4040

4141
foreach ($results as $result_file) {
42-
if (is_a($result_file, "Exception")) {
42+
if (is_a($result_file, "Throwable")) {
4343
exit(1);
4444
}
4545

0 commit comments

Comments
 (0)