Each page should be able to have its own error() function alongside go and do.
The same goes for the _common page.
Then there should be individual files in page/_error:
- 404.html // a special 404 page
- 404.php // special logic to execute for the 404
- @errorCode.html // any unhandled error will show this
- @errorCode.php // any unhandled error will be picked up here
- _common.php // handle logic for all errors here
Then we'll be able to have the following scenario:
- As a developer
- When I request an Entity in my page logic's
go function like function go(ShopItem $item)
- And the
ShopItem is loaded in the ServiceLoader according to the DynamicPath
- But there is no matching
ShopItem for the current DynamicPath
- Then the
ServiceLoader throws a ShopItemNotFoundException
- And the page logic's
error(Throwable $reason) function is called
- And the generic
page/_error/@errorCode.html is displayed
Each page should be able to have its own
error()function alongsidegoanddo.The same goes for the
_commonpage.Then there should be individual files in
page/_error:Then we'll be able to have the following scenario:
gofunction likefunction go(ShopItem $item)ShopItemis loaded in theServiceLoaderaccording to theDynamicPathShopItemfor the currentDynamicPathServiceLoaderthrows aShopItemNotFoundExceptionerror(Throwable $reason)function is calledpage/_error/@errorCode.htmlis displayed