Skip to content

Commit 8e63e23

Browse files
Merge pull request #196 from MarcinOrlowski/dev
Release v9.2.3
2 parents 439ceaf + 7ad61db commit 8e63e23

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "marcin-orlowski/laravel-api-response-builder",
33
"description": "Helps building nice, normalized and easy to consume Laravel REST API.",
44
"homepage": "https://github.com/MarcinOrlowski/laravel-api-response-builder",
5-
"version": "9.2.2",
5+
"version": "9.2.3",
66
"keywords": [
77
"laravel",
88
"json",

docs/CHANGES.md

+4
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

+3-3
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

+1-1
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

+1-1
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

+1-1
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)