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)