Skip to content

Commit 178ac8a

Browse files
committed
Update README.md
1 parent 693636e commit 178ac8a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,18 @@ $fruits = Block::make($fruitsArray)
458458
->throwOnMissingKey();
459459

460460
$nothing = $fruits->get("a-missing-key"); // throws exception
461+
```
461462

463+
You can also pass your own exception class (must extend `\Throwable`).
462464

465+
```php
463466
$fruits->throwOnMissingKey(
464467
MyMissingKeyException::class,
465-
"The key in the configuration JSON file doens't exist?"
468+
"The key in the JSON configuration file does not exist?"
466469
);
470+
$nothing = $fruits->get("a-missing-key"); // throws your custom exception
467471
```
468472

469-
You can also pass your own exception class (must extend `\Throwable`).
470-
471473
#### Summary for the "missing key behavior"
472474

473475
| Mode | Result |

0 commit comments

Comments
 (0)