This adds a compile "task" for when the compiler of
semantics (JCI) is called later on with compileAll()\
which actually does the compiling.
The ErrorHandler is required to map the errors back to the
element that caused it.
5644
public void addClassCompileTask(final String className,
                                    final BaseDescr descr,
                                    final String text,
                                    final MemoryResourceReader src,
                                    final ErrorHandler handler) {
        final String fileName = className.replace('.',
                                                  '/') + ".java";

        if (src != null) {
            src.add(fileName,
                    text.getBytes(IoUtils.UTF8_CHARSET));
        } else {
            this.src.add(fileName,
                         text.getBytes(IoUtils.UTF8_CHARSET));
        }

        this.errorHandlers.put(fileName,
                               handler);

        addClassName(fileName);
    }
560068
public static <TResult> Task<TResult> forError(Exception error) {
    bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
    tcs.setError(error);
    return tcs.getTask();
  }
32061
function (error) {
        if (!this.started) {
            return;
        }

        var errorHandlers = this.errorHandlers,
            length = errorHandlers.length,
            errorHandler,
            errorHandled = false,
            errorString,
            i;

        //Exit handling
        if (error instanceof SystemExit) {
            this._exit(error.code);
            return;
        }

        try {
            for (i = 0; i < length; i += 1) {
                errorHandler = errorHandlers[i];
                errorHandled = !!errorHandler(error);

                if (errorHandled) {
                    return;
                }
            }
        } catch (e) {
            this._printError(e);
            this._exit(1);
        }

        //Default error handling
        errorString = '' + (error.stack || error);
        this._printError(errorString);
        this._exit(1);
    }
986306
private boolean compileCurrent() throws IOException {
        Specification spec;
        Mapper result;

        output.normal(currentJob.source + ":");
        if (currentJob.listing != null) {
            output.openListing(currentJob.listing);
        }
        spec = (Specification) mapperMapper.invoke(currentJob.source);
        if (spec == null) {
            return false;
        }
        try {
            result = spec.translate(currentJob.k, currentJob.threadCount, output);
            compiler.run(result, spec.getMapperName(), currentJob.source, currentJob.outputPath);
        } catch (GenericException e) {
            output.error(currentJob.source.getName(), e);
            return false;
        } catch (IOException e) {
            output.error(currentJob.source.getName(), e.getMessage());
            return false;
        }
        return true;
    }
1147555
final void addError( ParsedElement parsedElement, ResourceKey errorMsg )
  {
    verify( parsedElement, false, errorMsg, EMPTY_ARRAY );
  }
18904
function createCompilerError(
  message: string,
  locations?: ?$ReadOnlyArray<Location>,
  nodes?: ?$ReadOnlyArray<ASTNode>,
): CompilerError {
  let messageWithLocations = message;
  if (locations != null) {
    const printedLocations = printLocations(locations);
    messageWithLocations =
      printedLocations.length === 0
        ? message
        : [message, ...printedLocations].join('\n\n') + '\n';
  }
  const error = new GraphQLError(
    `Internal Error: ${messageWithLocations}`,
    nodes ?? [],
  );
  return new Error(error.message);
}
673059
@Override public void addError(String message) {
		ast.printMessage(Diagnostic.Kind.ERROR, message, this, null, true);
	}
758078
@Override
	public void registerErrorHandlers(ErrorHandler... handlers) {
		if (handlers != null) {
			for (ErrorHandler handler : handlers) {
				this.registerErrorHandler(handler);
			}
		}
	}
1121101
def error_handler(task):
    """"""
    @wraps(task)
    def wrapper(self, *args, **kwargs):
        try:
            return task(self, *args, **kwargs)
        except Exception as e:
            self.connected = False
            if not self.testing:
                exc_type, exc_obj, exc_tb = sys.exc_info()
                fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
                error_message = (
                    "[" + str(datetime.now()) + "] Error in task \"" +
                    task.__name__ + "\" (" +
                    fname + "/" + str(exc_tb.tb_lineno) +
                    ")" + e.message
                )
                self.logger.error("%s: RPC instruction failed" % error_message)
    return wrapper
892766
function(json) {
        if (json.serverErrors) {
            this._handleNoCompiledCode(json.serverErrors);
        } else {
            json.compiledCode = this._header + json.compiledCode;

            if (this.file) {
                this._writeOutputTofile(json.compiledCode);
            }

            if (this.callback) {
                this.callback((this._passJson) ? json : json.compiledCode);
            }

            if (!this.file && !this.callback) {
                this.console.info('Code:', json.compiledCode);
            }
        }
    }
1194178
public void addError(Throwable error) {
        if (error == null) {
            throw new NullPointerException("Error cannot be null");
        }
        if (error instanceof AssumptionViolatedException) {
            AssertionError e = new AssertionError(error.getMessage());
            e.initCause(error);
            errors.add(e);
        } else {
            errors.add(error);
        }
    }
121454
public static void postTaskError(final TaskCompletionListener completionListener, final String errorMessage) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                if (null != completionListener) {
                    completionListener.onError(errorMessage);
                }
            }
        });
    }
690724
function compileCallback(callback, method) {
    var client = this.client;

    // Build the callback
    var builder = client.queryBuilder();
    callback.call(builder, builder);

    // Compile the callback, using the current formatter (to track all bindings).
    var compiler = client.queryCompiler(builder);
    compiler.formatter = this;

    // Return the compiled & parameterized sql.
    return compiler.toSQL(method || 'select');
  }
429313
public static JSError make(Node n, DiagnosticType type, String... arguments) {
    return new JSError(n.getSourceFileName(), n, type, arguments);
  }
148694
function compile(
  source,
  filename = '',
  includeModule = false,
  debugMode = false,
) {
  let res
  let resName
  let errors

  try {
    const [moduleName, bsCode, diagnosticErrors] = Retyped.compile(filename, source, debugMode)
    const fmtCode = format(bsCode)
    res = fmtCode
    resName = moduleName
    errors = diagnosticErrors
  } catch (e) {
    console.error(e)
    throw new Error(`${e[0][0]}`)
  }

  if (res.includes('SYNTAX ERROR>')) {
    throw new Error(res)
  }

  if (!includeModule) {
    return res
  } else {
    return {
      moduleName: resName,
      bsCode: res,
      diagnosticErrors: errors
    }
  }
}
222775
public void addConfiguredCompiler(final CompilerDef compiler) {
    if (compiler == null) {
      throw new NullPointerException("compiler");
    }
    compiler.setProject(getProject());
    this._compilers.addElement(compiler);
  }
208980
public void addTocError(final BaseTopicWrapper<?> topic, final ErrorType errorType, final String error) {
        addItem(topic, error, ErrorLevel.ERROR, errorType);
    }