Provide details of Sass errors
430426
function throwSassError(sassError) {
  throw new gutil.PluginError({
    plugin: 'sass',
    message: util.format("Sass error: '%s' on line %s of %s", sassError.message, sassError.line, sassError.file)
  });
}
1315929
def parse!
      begin
        parse
      rescue Exception => e
        # Exit code 65 indicates invalid data per
        # http://www.freebsd.org/cgi/man.cgi?query=sysexits. Setting it via
        # at_exit is a bit of a hack, but it allows us to rethrow when --trace
        # is active and get both the built-in exception formatting and the
        # correct exit code.
        at_exit {exit Sass::Util.windows? ? 13 : 65} if e.is_a?(Sass::SyntaxError)

        raise e if @options[:trace] || e.is_a?(SystemExit)

        if e.is_a?(Sass::SyntaxError)
          $stderr.puts e.sass_backtrace_str("standard input")
        else
          $stderr.print "#{e.class}: " unless e.class == RuntimeError
          $stderr.puts e.message.to_s
        end
        $stderr.puts "  Use --trace for backtrace."

        exit 1
      end
      exit 0
    end
728264
function sassVars (filePath) {
    const declarations = collectDeclarations(filePath);
    let variables = {};

    if (!declarations.length) {
        message('Warning: Zero declarations found');
        return;
    }

    declarations.forEach(function (declaration) {
        const parsedDeclaration = parseDeclaration(declaration);
        const varName = parsedDeclaration.key;
        let varValue = parsedDeclaration.value;
        const valueType = getValueType(varValue);

        /*
         * $key: $value;
         */
        if (valueType === 'var') {
            const localVarName = varValue;
            varValue = getVarValue(localVarName, variables);

            if (!varValue) {
                message(`Warning: Null value for variable ${localVarName}`);
            }
        }

        /*
         * $key: ($value-1 + $value-2) * $value-3 ... ;
         */
        if (valueType === 'expression') {
            // todo
        }

        /*
         * $key: value;
         */
        variables[varName] = varValue;
    });

    return variables;
}
2849
async function compileProgram (dirPath, command) {
  await validateDirPathForCLI(dirPath);
  const params = pick(command, [
    'fontName',
    'sassPlaceholder',
    'cssClass',
    'fontTypes',
    'styleFormats',
    'styleDest',
    'styleName',
    'fontDest',
    'authorName',
    'authorUrl',
    'className',
    'previewDest',
    'preview',
    'catalogDest',

    'experimentalFontOnCatalog',
    'experimentalDisableStyles'
  ]);

  try {
    return collecticonsCompile({
      dirPath,
      ...params
    });
  } catch (error) {
    if (!error.userError) throw error;
    // Capture some errors and convert to their command line alternative.
    const code = error.code;
    if (code === 'PLC_CLASS_EXC') {
      error.details = ['Error: --no-sass-placeholder and --no-css-class are mutually exclusive'];
    } else if (code === 'FONT_TYPE') {
      error.details = ['Error: invalid font type value passed to --font-types'];
    } else if (code === 'CLASS_CSS_FORMAT') {
      error.details = ['Error: "--no-css-class" and "--style-formats css" are not compatible'];
    } else if (code === 'STYLE_TYPE') {
      error.details = ['Error: invalid style format value passed to --style-format'];
    }

    throw error;
  }
}
532026
def render_issue(self, description='', traceback=''):
        """"""
        # Get component versions
        versions = get_versions()

        # Get git revision for development version
        revision = ''
        if versions['revision']:
            revision = versions['revision']

        # Make a description header in case no description is supplied
        if not description:
            description = "### What steps reproduce the problem?"

        # Make error section from traceback and add appropriate reminder header
        if traceback:
            error_section = ("### Traceback\n"
                             "```python-traceback\n"
                             "{}\n"
                             "```".format(traceback))
        else:
            error_section = ''
        issue_template = """\
## Description

{description}

{error_section}

## Versions

* Spyder version: {spyder_version} {commit}
* Python version: {python_version}
* Qt version: {qt_version}
* {qt_api_name} version: {qt_api_version}
* Operating System: {os_name} {os_version}

### Dependencies

```
{dependencies}
```
""".format(description=description,
           error_section=error_section,
           spyder_version=versions['spyder'],
           commit=revision,
           python_version=versions['python'],
           qt_version=versions['qt'],
           qt_api_name=versions['qt_api'],
           qt_api_version=versions['qt_api_ver'],
           os_name=versions['system'],
           os_version=versions['release'],
           dependencies=dependencies.status())

        return issue_template
1359711
function compileSass(path, ext, file, callback) {
  let compiledCss = sass.renderSync({
    file: path,
    outputStyle: 'compressed',
  });
  callback(null, compiledCss.css);
}
1307073
function(path, options) {

        var errors = hintFiles([path],
                               {options: options.jshintOptions,
                                withDefaults: options.withDefaults,
                                globals: options.globals},
                               false);
        var flattened_errors = [].concat.apply([], errors);
        var formatted_errors = flattened_errors.map(function(error) {
            return '' + path + ': ' + error.line + ":" + error.character + " " + error.reason;
        });

        return formatted_errors.join('\n');
    }
22862
def call_and_catch_errors(self, f, *args, **kwargs):
        
        try:
            return f(*args, **kwargs)
        except SassError as e:
            if self.live_errors:
                # TODO should this setting also capture and display warnings?
                return e.to_css()
            else:
                raise
543135
function error(err) {
      this.log(`${chalk.red(`${err.name.toLowerCase()}:`)} ${err.message}`);
    }
927993
def render_error(request, exc):
    ''''''
    cfg = request.get('pulsar.cfg')
    debug = cfg.debug if cfg else False
    response = request.response
    if not response.content_type:
        content_type = request.get('default.content_type')
        response.content_type = request.content_types.best_match(
            as_tuple(content_type or DEFAULT_RESPONSE_CONTENT_TYPES)
        )
    content_type = None
    if response.content_type:
        content_type = response.content_type.split(';')[0]
    is_html = content_type == 'text/html'

    if debug:
        msg = render_error_debug(request, exc, is_html)
    else:
        msg = escape(error_messages.get(response.status_code) or exc)
        if is_html:
            msg = textwrap.dedent("""
                <h1>{0[reason]}</h1>
                {0[msg]}
                <h3>{0[version]}</h3>
            """).format({"reason": response.status, "msg": msg,
                         "version": request.environ['SERVER_SOFTWARE']})
    #
    if content_type == 'text/html':
        doc = HtmlDocument(title=response.status)
        doc.head.embedded_css.append(error_css)
        doc.body.append(Html('div', msg, cn='pulsar-error'))
        return doc.to_bytes(request)
    elif content_type in JSON_CONTENT_TYPES:
        return json.dumps({'status': response.status_code,
                           'message': msg})
    else:
        return '\n'.join(msg) if isinstance(msg, (list, tuple)) else msg
868247
def compile_sass(input_file, output_file):
    
    from .modules import sass

    if not isinstance(input_file, str):
        raise RuntimeError('SASS compiler takes only a single input file.')

    return {
        'dependencies_fn': sass.sass_dependencies,
        'compiler_fn': sass.sass_compile,
        'input': input_file,
        'output': output_file,
        'kwargs': {},
    }
1363051
def error_output(self, message, method_affected=None):
        
        color_fn = self._py3_wrapper.get_config_attribute
        color = color_fn(self.module_full_name, "color_error")
        if hasattr(color, "none_setting"):
            color = color_fn(self.module_full_name, "color_bad")
        if hasattr(color, "none_setting"):
            color = None

        error = {
            "full_text": message,
            "color": color,
            "instance": self.module_inst,
            "name": self.module_name,
        }
        for method in self.methods.values():
            if method_affected and method["method"] != method_affected:
                continue

            method["last_output"] = [error]

        self.allow_config_clicks = False
        self.set_updated()
1145942
function getLoggableErrorMessage(error: Error): string | void {
  let result = chalk.red.bold('Error: ');

  if (error instanceof errorTypes.ConfigFatalError) {
    result += 'Fatal configuration error.\n\n';
    result += `${error.message}\n`;
    return result;
  }

  if (error instanceof errorTypes.ConfigValidationError) {
    result += 'Invalid configuration.\n\n';
    if (error.messages) {
      error.messages.forEach((m) => {
        result += `- ${m}\n`;
      });
    } else {
      result += `${error.message}\n`;
    }
    return result;
  }

  if (error instanceof errorTypes.WebpackFatalError) {
    const webpackOptions = [
      'webpackLoaders',
      'webpackPlugins',
      'webpackStaticIgnore'
    ]
      .map((x) => chalk.yellow(x))
      .join(', ');
    result += `Webpack fatal error. Please check any Batfish configuration options that pass directly into Webpack configuration (${webpackOptions}).\n\n`;
    result += `Error message: ${error.originalError.message}\n`;
    return result;
  }

  if (error instanceof errorTypes.WebpackCompilationError) {
    result += `Webpack compilation error.\n\n`;
    const formattedMessages = webpackFormatMessages(error.stats);
    formattedMessages.errors.forEach((errorMessage) => {
      result += `${errorMessage}\n`;
    });
    return result;
  }

  if (error instanceof errorTypes.CssCompilationError) {
    result += `CSS compilation error. This may mean you have non-standard syntax that you forgot to compile with PostCSS.\n\n`;
    result += `${error.message}\n`;
    return result;
  }

  if (error instanceof errorTypes.WebpackNodeParseError) {
    result += `Failed to parse Webpack-compiled version of static-render-pages.js\n\n`;
    result += `Error message: ${error.originalError.message}\n\n`;
    result += renderPrettyErrorStack(error.originalError);
    return result;
  }

  if (error instanceof errorTypes.WebpackNodeExecutionError) {
    result += `Failed to execute Webpack-compiled version of static-render-pages.js.\n\n${chalk.bold.yellow(
      'You may be importing a JS file that cannot run in Node.'
    )}\n\n`;
    result += renderPrettyErrorStack(error.originalError);
    return result;
  }

  if (error instanceof errorTypes.FrontMatterError) {
    result += `Failed to parse front matter in ${chalk.yellow(
      path.relative(process.cwd(), error.filePath)
    )}.\n\n`;
    if (error.originalError.name === 'YAMLException') {
      result += `YAML error: ${error.originalError.reason}\n\n`;
      result += codeFrame.codeFrameColumns(
        error.originalError.mark.buffer,
        {
          start: {
            line: error.originalError.mark.line + 1,
            column: error.originalError.mark.column
          }
        },
        { highlightCode: true, linesAbove: 10, linesBelow: 10 }
      );
    } else {
      result += renderPrettyErrorStack(error.originalError);
    }
    return result;
  }

  return;
}
1196404
def error_details
      msg = ''
      @runner.failures.each do |checker|
        # msg << error("------- #{checker.name} -------") << "\n"
        # msg << error("#{checker.hint}") << "\n"
        checker.errors.details.each do |type, content|
          case type
          when :source
            content.each_line.with_index do |l, i|
              msg << yellow((i + 1).to_s.rjust(3)) << '|' << l
            end
          when Integer
            msg << info('Line: ') << yellow(type) << '|' << info(content)
          when Array
            msg << info('Pos: ') << yellow(type.join(',')) << '|' << info(content)
          when nil
            msg << info(content)
          end
          msg << "\n"
        end
      end
      msg
    end
784479
function(error) {
  return util.format('  %s: %s',
    chalk.magenta(error.plugin.name),
    error.message);
}
760995
function showLoadingErrors() {
  const failedTasks = []
  const taskStatus = {}

  // Construct data for full report
  for (const data of scripts) {
    const messages = []
    // check sources
    const mSources = data.sources.filter(s => glob.sync(s).length === 0)
    if (mSources.length !== 0) {
      messages.push(
        `✘ Missing sources: ${(mSources.length > 1 ? '\n  ' : '') +
          mSources.map(s => `'${s}'`).join('\n  ')}`
      )
    }
    // display remaining errors
    for (const error of data.errors) {
      let msg = error.message || error.toString()
      const prefix = msg.startsWith('Error') ? '' : 'Error: '
      messages.push(`✘ ${prefix}${msg.replace(/\n/g, '\n  ')}`)
    }
    if (messages.length > 0) {
      failedTasks.push(data.name)
    } else {
      messages.push(`✔ No issues detected`)
    }
    taskStatus[data.name] = messages
  }

  if (failedTasks.length !== 0) {
    const messages = []
    for (const key of Object.keys(taskStatus)) {
      messages.push(
        `${key}:\n  ${taskStatus[key].join('\n').replace(/\n/g, '\n  ')}`
      )
    }

    showError(
      new Error(
        `${failedTasks.length > 1 ? 'Errors' : 'Error'} in ${failedTasks
          .map(s => `'${s}'`)
          .join(', ')}\n${messages.join('\n')}`
      )
    )
  }
}
760676
def prettify_exc(error):
    """"""
    matched_exceptions = [k for k in KNOWN_EXCEPTIONS.keys() if k in error]
    if not matched_exceptions:
        return "{}".format(vistir.misc.decode_for_output(error))
    errors = []
    for match in matched_exceptions:
        _, error, info = error.rpartition(KNOWN_EXCEPTIONS[match])
        errors.append("{} {}".format(error, info))

    return "\n".join(errors)