Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layers of error handling #642

Open
g105b opened this issue Dec 7, 2023 · 0 comments
Open

Layers of error handling #642

g105b opened this issue Dec 7, 2023 · 0 comments
Assignees
Projects

Comments

@g105b
Copy link
Member

g105b commented Dec 7, 2023

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
@g105b g105b added this to Backlog in Overview via automation Dec 7, 2023
@g105b g105b self-assigned this Dec 7, 2023
@g105b g105b moved this from Backlog to WIP in Overview Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant