Skip to content

Commit eb2255c

Browse files
Merge pull request #195 from MarcinOrlowski/exception-handlers-signature-194
Changed signature of ExceptionHandlers' `handle()`
2 parents 439ceaf + 1cf2552 commit eb2255c

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

docs/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
99
## CHANGE LOG ##
1010

11+
* v9.2.3 (2021-04-21)
12+
* [RB-194] Changed signature of ExceptionHandlers' `handle()` method to expectc `Throwable`
13+
instead of `Exception` (reported by @genesiscz).
14+
1115
* v9.2.2 (2021-03-05)
1216
* [RB-190] Fixed converting resource and resource collection (reported by @achinkumar121).
1317

src/Contracts/ExceptionHandlerContract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ interface ExceptionHandlerContract
3232
* `msg_key` is set, or message referenced by `msg_key` completely ignoring exception
3333
* message ($ex->getMessage()).
3434
*
35-
* @param array $config Config array (can be empty) with any keys required by given handle.
36-
* @param \Exception $ex The exception to handle.
35+
* @param array $user_config Config array (can be empty) with any keys required by given handle.
36+
* @param \Throwable $ex The throwable to handle.
3737
*
3838
* @return array|null
3939
*/
40-
public function handle(array $config, \Exception $ex): ?array;
40+
public function handle(array $user_config, \Throwable $ex): ?array;
4141
}

src/ExceptionHandlers/DefaultExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
final class DefaultExceptionHandler implements ExceptionHandlerContract
2626
{
27-
public function handle(array $user_config, /** @scrutinizer ignore-unused */ \Exception $ex): ?array
27+
public function handle(array $user_config, /** @scrutinizer ignore-unused */ \Throwable $ex): ?array
2828
{
2929
$defaults = [
3030
RB::KEY_API_CODE => BaseApiCodes::EX_UNCAUGHT_EXCEPTION(),

src/ExceptionHandlers/HttpExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
final class HttpExceptionHandler implements ExceptionHandlerContract
2626
{
27-
public function handle(array $user_config, \Exception $ex): ?array
27+
public function handle(array $user_config, \Throwable $ex): ?array
2828
{
2929
$default_config = [
3030
// used by unauthenticated() to obtain api and http code for the exception

src/ExceptionHandlers/ValidationExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
final class ValidationExceptionHandler implements ExceptionHandlerContract
2626
{
27-
public function handle(array $user_config, /** @scrutinizer ignore-unused */ \Exception $ex): ?array
27+
public function handle(array $user_config, /** @scrutinizer ignore-unused */ \Throwable $ex): ?array
2828
{
2929
return [
3030
RB::KEY_API_CODE => BaseApiCodes::EX_VALIDATION_EXCEPTION(),

0 commit comments

Comments
 (0)