Skip to content

Error handling #299

@g105b

Description

@g105b

On Logic classes, an error function can be called like the go and do functions, when an error occurs. This can allow the developer to decide how to display the error to the user, rather than a PHP error being shown.

Error functions can be optional in the Logic class, as if none is defined, WebEngine will look at other Logic classes, such as Dynamic pages, and throw them in there instead, finally by simply returning the white screen of death.

The order of error functions:

  • The current Logic object
  • The dynamic Logic object that's currently executing
  • _common.php Logic objects, from most-nested to least-nested
  • _error.php special logic object.

In _error.php, the go function can do any logging that is required, and the error function can be called as usual, but the setView() function can be used to hook up different error HTML views for different types of error (403, 404, 500, etc).

Metadata

Metadata

Assignees

Labels

enhancementNon-breaking improvements to existing behaviourquestionUsage questions or clarification requests

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions