Skip to content

Commit 835b453

Browse files
authored
Merge pull request #40 from codeclimate/gd-string
Return string when error is thrown
2 parents 831b5d6 + dfb8ce0 commit 835b453

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function run($files)
122122
return $resultFile;
123123
} catch (Exception $e) {
124124
error_log("Exception: " . $e->getMessage() . " in " . $e->getFile() . "\n" . $e->getTraceAsString());
125-
return false;
125+
return $e;
126126
}
127127
}
128128
}

engine.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131

3232
$results = $server->get_all_results();
3333

34-
// If there is no output from the runner, an exception must have occurred
35-
if (count($results) == 0) {
36-
exit(1);
37-
}
38-
3934
foreach ($results as $result_file) {
35+
if (is_a($result_file, "Exception")) {
36+
exit(1);
37+
}
38+
4039
$phpcs_output = json_decode(file_get_contents($result_file), true);
4140
unlink($result_file);
4241

0 commit comments

Comments
 (0)