Skip to content

Throwing Exceptions makes render unsuitable for use in __toString #1

@dwest

Description

@dwest

When mason cannot find a requested template file it throws an exception. Unfortunately if this happens inside a __toString method this causes a fatal error which cannot be caught and provides little information as to why the application died.

Possible solutions:

  • Have an error reporting level (EXCEPTION|WARN|IGNORE|LOG) for development, testing, and production.
  • Detect if a __toString method is anywhere on the callstack and use trigger_error instead (not a fan of this one).
  • Just always print a warning (is problematic in a production setting when errors should not appear to the user)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions