Make sure template errors reach the output
334204
function(str) {
            var output;
            try {
                output = opts.template(str);
            } catch (e) {
                e.message = error.badTemplate + ': ' + e.message;
                return this.emit('error', new PluginError('gulp-concat-filenames', e));
            }

            if (typeof output !== 'string') {
                return this.emit('error', new PluginError('gulp-concat-filenames', error.badTemplate));
            }
            return output;
        }
937951
def err(self, output, newline=True):
        """"""
        click.echo(output, nl=newline, err=True)
1306635
def _validate_templates(self, app, files, verbose):
        
        from uliweb import application
        from uliweb.core.template import template_file
        from uliweb.utils.common import trim_path

        app.template_loader.log = None
        for f in files:
            try:
                t = app.template_loader.load(f)
                if verbose:
                    print 'PASSED', f
            except Exception as e:
                print 'FAILED', f, str(e)
766228
def _process_templatedata(self, node, **_):
        

        # escape double quotes
        value = re.sub('"', r'\\"', node.data)

        # escape new lines
        value = re.sub('\n', r'\\n', value)

        # append value to the result
        self.output.write('__result += "' + value + '";')
114492
function(template, data){

    if (!template) {
      var error = new Error("Cannot render the template since it's false, null or undefined.");
      error.name = "TemplateNotFoundError";
      throw error;
    }

    var templateFunc;
    if (typeof template === "function"){
      templateFunc = template;
    } else {
      templateFunc = Marionette.TemplateCache.get(template);
    }

    return templateFunc(data);
  }
870441
def check_error(result, func, cargs):
    ""
    if result != 0:
        msg = 'Error in "%s": %s' % (func.__name__, get_errors(result) )
        raise RTreeError(msg)
    return
291949
static function dump_errors( $emask = PLUG_ERROR_REPORTING ){
		$errs = PLUGError::get_errors( $emask );
		foreach( $errs as $Err ){
			$s = $Err->__toString(). "\n";
			if( PLUG_CLI ){
				PLUGCli::stderr( $s );
			}
			else {
				echo $s;
			}
		}
	}
1308732
def perform_templating(args):
    """"""
    engine = engines.engines[args.engine]

    if args.vary:
        it = variable_outfile_iterator(args.outfiles,
                                       args.infiles,
                                       args.args,
                                       engine)
    else:
        it = constant_outfile_iterator(args.outfiles,
                                       args.infiles,
                                       args.args)

    process_combinations(it, engine,
                         tolerant=args.tolerant,
                         read_old=args.read_old,
                         delete_empty=args.delete_empty,
                         )
783928
function (args) {
        var div = args.cfg.tplDiv;

        if (div) {
            aria.utils.Dom.replaceHTML(div, "#TEMPLATE ERROR#");
        }
        this.$callback(args.cb, {
            success : false
        });
    }
756029
def _render_errors(field):
    
    template = '{0}/layout/field_errors.html'.format(appsettings.CRISPY_TEMPLATE_PACK)
    return render_to_string(template, {
        'field': field,
        'form_show_errors': True,
    })
774595
function (out) {
            var errorMessage;
            if (this._WidgetCfg.formatError) {// framework errors
                errorMessage = this._WidgetCfg.formatErrorMessages;
            } else if (this._WidgetCfg.error) {// template errors
                errorMessage = this._WidgetCfg.errorMessages;
            }

            var div = new ariaWidgetsContainerDiv({
                sclass : "errortip",
                width : 289,
                margins : "0 0 0 0"
            }, this._context);

            var msg = this._checkErrorMessage(errorMessage);
            if (this._WidgetCfg.waiAria) {
                div.addExtraAttributes('aria-hidden="true"');
                this._widget.waiReadText(msg, {
                    alert: true
                });
            }

            out.registerBehavior(div);
            div.writeMarkupBegin(out);
            out.write(msg);
            div.writeMarkupEnd(out);


            this._div = div;
        }
1001021
private function validateTemplate($type, $template)
    {
        $status = '<info>ok</info>';

        try {
            $this->validateTwigTemplate($template);
        } catch (\Exception $e) {
            $status = sprintf('<error>failed: %s</error>', $e->getMessage());
            $this->errors[] = $e->getMessage();
        }

        $this->output->writeln(
            sprintf(
                '    %s: %s -> %s',
                $type,
                $template,
                $status
            )
        );
    }
172788
def _handle_template_end(self):
        """"""
        if self._context & contexts.TEMPLATE_NAME:
            if not self._context & (contexts.HAS_TEXT | contexts.HAS_TEMPLATE):
                self._fail_route()
        elif self._context & contexts.TEMPLATE_PARAM_KEY:
            self._emit_all(self._pop())
        self._head += 1
        return self._pop()
286889
function(callback) {
      if (Object.keys(templateDependencies).indexOf(args['<template>']) === -1) {
        return callback(new Error(format('Unknown template "%s". Run '
          + '`mj help create` for list of valid templates.', args['<template>'])));
      }
      return callback(null);
    }
1255336
def fail(self, msg, lineno):
        """"""
        raise TemplateAssertionError(msg, lineno, self.name, self.filename)
639994
function AssertionFailedError(params, template) {
  this.params = params;
  this.template = template;
  // this.message = "AssertionFailedError";
  let stack = new Error().stack;
  // this.showDiff = true;
  stack = stack ? stack.split('\n').filter(line =>
    // @todo cut assert things nicer
    line.indexOf('lib/assert') < 0).join('\n') : '';
  this.showDiff = true;

  this.actual = this.params.actual;
  this.expected = this.params.expected;

  this.inspect = () => {
    const params = this.params || {};
    const msg = params.customMessage || '';
    return msg + subs(this.template, params);
  };

  this.cliMessage = () => this.inspect();
}
1049396
def template_exception_handler(fn, error_context, filename=None):
    """"""
    error_message = None
    if filename:
        error_context.update(filename=filename)
    try:
        return fn()
    except jinja2.TemplateSyntaxError as exc:
        error_context.update(filename=exc.filename, line_no=exc.lineno)
        error_message = exc.message
    except jinja2.TemplateError as exc:
        error_message = exc.message
    except Exception as exc:
        error_message = "%s" % exc

    raise TemplateError(message=error_message, context=error_context)