FileMaker Error - based on https://coderwall.com/p/m3-cqw
@param code
@param msg
@constructor
971928
function FileMakerServerError(code, url) {
  this.url = url;
  this.error = code;
  this.message = getMessge(code);
  this.name = 'FileMakerServerError';
  console.log('FileMaker Error Code: ',error);
  const err = Error(this.message); // http://es5.github.io/#x15.11.1
  this.stack = err.stack;
  this.isTransient = isTransient(code);
}
1230909
function error(code, msg) {
    var err = new Error(msg);
    err.errno = code;
    return err;
}
113490
public function errorHandler($code, $message, $file, $line)
    {
        $this->debug->setShowBackTrace(false);
        $this->debug->onUncaughtException(new \ErrorException($message, $code, 0, $file, $line));
    }
897800
function write(dir, code) {
  return new Promise(function (resolve, reject) {
    fse.ensureFile(dir, (err) => {
      if (err) return reject(err)
      fs.writeFile(dir, code, 'utf-8', (err) => {
        if (err) {
          return reject(err)
        }
        console.info(chalk.red(dir) + ' ' + chalk.green(getSize(code)))
        resolve()
      })
    })
  })
}
160849
@Override
    public void error( F0<String> msg )
    {
        if ( compilerLogger.isErrorEnabled() )
        {
            String msgString = msg.apply();
            errors.append( msgString ).append( '\n' );
            compilerLogger.error( msgString );
        }
    }
288905
public void error(final String msg)
    {
        errors++;

        if (!suppressOutput)
        {
            out.println("ERROR: " + msg);
        }

        if (stopOnError)
        {
            throw new IllegalArgumentException(msg);
        }
    }
92429
protected function handleError($code, $msg) {
    if (isset($this->options['error_handler'])) {
      $handler = $this->options['error_handler'];
      $handler($code, $msg);
    }

    if ($this->debug()) {
      error_log("[Analytics][" . $this->type . "] " . $msg);
    }
  }
221438
def raise_potential_error!(error_code)
      return if error_code.zero? || error_code == 401 || error_code == 101

      Filemaker::Errors.raise_error_by_code(error_code)
    end
1000424
@Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {

        if (!(msg instanceof HttpMessage || msg instanceof HttpContent)) {
            ctx.write(msg, promise);
            return;
        }

        boolean release = true;
        SimpleChannelPromiseAggregator promiseAggregator =
                new SimpleChannelPromiseAggregator(promise, ctx.channel(), ctx.executor());
        try {
            Http2ConnectionEncoder encoder = encoder();
            boolean endStream = false;
            if (msg instanceof HttpMessage) {
                final HttpMessage httpMsg = (HttpMessage) msg;

                // Provide the user the opportunity to specify the streamId
                currentStreamId = getStreamId(httpMsg.headers());

                // Convert and write the headers.
                Http2Headers http2Headers = HttpConversionUtil.toHttp2Headers(httpMsg, validateHeaders);
                endStream = msg instanceof FullHttpMessage && !((FullHttpMessage) msg).content().isReadable();
                writeHeaders(ctx, encoder, currentStreamId, httpMsg.headers(), http2Headers,
                        endStream, promiseAggregator);
            }

            if (!endStream && msg instanceof HttpContent) {
                boolean isLastContent = false;
                HttpHeaders trailers = EmptyHttpHeaders.INSTANCE;
                Http2Headers http2Trailers = EmptyHttp2Headers.INSTANCE;
                if (msg instanceof LastHttpContent) {
                    isLastContent = true;

                    // Convert any trailing headers.
                    final LastHttpContent lastContent = (LastHttpContent) msg;
                    trailers = lastContent.trailingHeaders();
                    http2Trailers = HttpConversionUtil.toHttp2Headers(trailers, validateHeaders);
                }

                // Write the data
                final ByteBuf content = ((HttpContent) msg).content();
                endStream = isLastContent && trailers.isEmpty();
                release = false;
                encoder.writeData(ctx, currentStreamId, content, 0, endStream, promiseAggregator.newPromise());

                if (!trailers.isEmpty()) {
                    // Write trailing headers.
                    writeHeaders(ctx, encoder, currentStreamId, trailers, http2Trailers, true, promiseAggregator);
                }
            }
        } catch (Throwable t) {
            onError(ctx, true, t);
            promiseAggregator.setFailure(t);
        } finally {
            if (release) {
                ReferenceCountUtil.release(msg);
            }
            promiseAggregator.doneAllocatingPromises();
        }
    }
585402
function presentErrorMsg (errorCode) {
    const msg = window._i18n.t(errorCode)
    let wfLoadingModal = document.getElementById('wf-loading-modal')
    wfLoadingModal.className = `wf wf-theme-${theme}` // cancel flicker animation

    let msgSpan = wfLoadingModal.children[1]
    msgSpan.innerHTML = msg
    msgSpan.style.color = 'red'
  }
1315657
function Exception(code, message) {
    const factory = Object.create(Exception.prototype);
    factory.code = code;
    factory.message = message;
    factory.stack = factory.toString();
    return factory;
}
838791
private synchronized void issueTaggingFailedMessage(int returnCode) {
        if (taggingFailedIssued) {
            return;
        }

        System.err.println(MessageFormat.format(BootstrapConstants.messages.getString("warn.unableTagFile"), returnCode));
        taggingFailedIssued = true;
    }
825168
@Override
    public void sendError(int code, String message) throws IOException {
        if (isCommitted()) {
            throw new IllegalStateException("Response already committed");
        }
        resetBuffer();
        this.response.setStatus(code);
        commit();
        if (null != message) {
            if (null != this.outWriter) {
                this.outWriter.print(message);
            } else {
                this.outStream.print(message);
            }
            flushBuffer();
        }
    }
68461
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public static HttpResponseException error(int code, String errorMessage) {
        return error(code,new Exception(errorMessage));
    }
815880
private static void reportError(List messages, String fileName, int lineNr, String line, String errorMessage) {
		messages.add(new Date() + " ERROR in \"" + fileName + "\" at line " + lineNr + ':');
		messages.add(errorMessage);
	}
20415
public function error(int $code = 0, string $msg = null, ...$args): void
    {
        if ($msg !== null && $args !== []) {
            $msg = \sprintf($msg, ...$args);
        }

        /* @noinspection PhpUnhandledExceptionInspection */
        throw new ActionError($msg, $code);
    }
1247217
protected StatusObject generateErrorResult(String code, Throwable error) {
        // Construct error object to return
        String message = "";
        while (error != null && error.getCause() != null) {
            error = error.getCause();
        }
        if (error != null && error.getMessage() != null) {
            message = error.getMessage();
        }
        StatusObject status = new StatusObject(code, "error", message);
        if (error instanceof ClientDetailsException) {
            // Return exception details to client
            status.setApplication(((ClientDetailsException) error).getParameters());
            if (((ClientDetailsException) error).includeStacktrace()) {
                List<String> stack = new ArrayList<String>();
                for (StackTraceElement element : error.getStackTrace()) {
                    stack.add(element.toString());
                }
                status.setAdditional("stacktrace", stack);
            }
        } else if (error != null) {
            status.setApplication(error.getClass().getCanonicalName());
            List<String> stack = new ArrayList<String>();
            for (StackTraceElement element : error.getStackTrace()) {
                stack.add(element.toString());
            }
            status.setAdditional("stacktrace", stack);
        }
        return status;
    }