Skip to content

Layers of error handling #642

Open
Open
@g105b

Description

@g105b

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions