Skip to content

Commit

Permalink
Improved exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Jul 9, 2017
1 parent 319f996 commit 8686527
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion src/Connection/HTTPlugConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function call(array $params, string $requestMethod = 'GET'): array
} catch (ApiException $e) {
throw $e;
} catch (\Exception $e) {
throw new ApiException('Technical error occurred.', 500);
throw new ApiException('Technical error occurred.', 500, $e);
}
}

Expand Down
11 changes: 0 additions & 11 deletions src/Exception/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@

final class ApiException extends \Exception
{
/**
* ApiException constructor.
*
* @param string $message
* @param int $code
*/
public function __construct(string $message, int $code = 0)
{
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 8686527

Please sign in to comment.