Improved error reporting in a sandboxed template