Skip to content

Commit

Permalink
Merge pull request #12 from fcastilloes/catch-throwable
Browse files Browse the repository at this point in the history
Catch Throwable instead of Exception
  • Loading branch information
fcastilloes committed Apr 29, 2017
2 parents 6dd8eac + 431c1a2 commit 061c8c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Executor/AbstractExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Katana\Sdk\Console\CliInput;
use Katana\Sdk\Logger\KatanaLogger;
use Katana\Sdk\Messaging\Responder\ResponderInterface;
use Throwable;

/**
* Base class for component executors
Expand Down Expand Up @@ -75,7 +76,7 @@ protected function executeCallback(
) {
try {
$response = $callbacks[$action]($api);
} catch (Exception $response) {
} catch (Throwable $response) {
// Catch as response to allow return or throw Exception
}

Expand All @@ -85,7 +86,7 @@ protected function executeCallback(
return true;
}

if (!$response instanceof Exception) {
if (!$response instanceof Throwable) {
$response = new Exception('Wrong return from callback');
}

Expand Down

0 comments on commit 061c8c8

Please sign in to comment.