C++ setErrorContext()
769799
private String appendErrorContext(String reason) {
        // Note: This relies on the calling code maintaining the ruleIndex
        // at a position that is useful for debugging.
        // For example, at the beginning of a reset or relation etc.
        StringBuilder msg = new StringBuilder(reason);
        msg.append(" at index ").append(ruleIndex);
        // We are not counting line numbers.

        msg.append(" near \"");
        // before ruleIndex
        int start = ruleIndex - (U_PARSE_CONTEXT_LEN - 1);
        if(start < 0) {
            start = 0;
        } else if(start > 0 && Character.isLowSurrogate(rules.charAt(start))) {
            ++start;
        }
        msg.append(rules, start, ruleIndex);

        msg.append('!');
        // starting from ruleIndex
        int length = rules.length() - ruleIndex;
        if(length >= U_PARSE_CONTEXT_LEN) {
            length = U_PARSE_CONTEXT_LEN - 1;
            if(Character.isHighSurrogate(rules.charAt(ruleIndex + length - 1))) {
                --length;
            }
        }
        msg.append(rules, ruleIndex, ruleIndex + length);
        return msg.append('\"').toString();
    }
676750
private void updateContext(Container c ,int maxCtx, int ctxSteps, boolean keepCustomValues)
  {

    if(!keepCustomValues)
    {
      c.removeAllItems();
    }
    
    for (Integer i : PREDEFINED_CONTEXTS)
    {
      if (i < maxCtx)
      {
        c.addItem(i);
      }
    }

    for (int step = ctxSteps; step < maxCtx; step += ctxSteps)
    {
      c.addItem(step);
    }

    c.addItem(maxCtx);

  }
39317
private static function setErrors($errors) {

        $std_rpc_errors = array(
            -32700 => "Parse error",
            -32701 => "Parse error - Unsupported encoding",
            -32702 => "Parse error - Invalid character for encoding",
            -32600 => "Invalid Request",
            -32601 => "Method not found",
            -32602 => "Invalid params",
            -32603 => "Internal error",
            -32500 => "Application error",
            -32400 => "System error",
            -32300 => "Transport error",
            // Predefined Comodojo Errors
            -31000 => "Multicall is available only in XMLRPC",
            -31001 => "Recursive system.multicall forbidden"
        );

        foreach ( $std_rpc_errors as $code => $message ) {

            $errors->add($code, $message);

        }

    }
68358
function setTimeoutContext(fn, ctx, timeout) {
  var id;

  var cancel = function() {
    clearTimeout(id);
  };

  id = setTimeout(function() {
    ctx.removeListener('cancel', cancel);

    fn();
  }, timeout);

  ctx.once('cancel', cancel);
}
376842
public void setContextLimits(int contextStart, int contextLimit) {
        if(contextStart<0) {
            this.contextStart=0;
        } else if(contextStart<=rep.length()) {
            this.contextStart=contextStart;
        } else {
            this.contextStart=rep.length();
        }
        if(contextLimit<this.contextStart) {
            this.contextLimit=this.contextStart;
        } else if(contextLimit<=rep.length()) {
            this.contextLimit=contextLimit;
        } else {
            this.contextLimit=rep.length();
        }
        reachedLimit=false;
    }
1275318
protected function jobErrorContext()
    {
        if (!Mage::getStoreConfigFlag('system/cron/enableErrorLog')) {
            return;
        }

        $settings = array(
            'error_reporting' => intval(Mage::getStoreConfig('system/cron/errorLevel')),
            'log_errors' => true,
            'display_errors' => true,
            'error_log' => $this->getErrorLogFile()
        );

        restore_error_handler();
        // (doesn't work for PHP 5.3) set_error_handler(null); // switch to PHP default error handling

        if (!is_dir(dirname($settings['error_log']))) {
            mkdir(dirname($settings['error_log']), 0775, true);
        }

        foreach ($settings as $key => $value) {
            // backup original settings first
            $this->errorSettingsBackup[$key] = ini_get($key);
            // set new value
            ini_set($key, $value);
        }
    }
990972
def SetFileContext(self, file_name, row_num, row, headers):
    
    self._context = (file_name, row_num, row, headers)
1091147
function toContext()
    {
        $options  = new Std\Type\StdTravers($this);
        $options  = $options->toArray(function($val) {
            ### we don`t want null values on context params
            return ($val === null);
        });

        $params = (isset($options['params'])) ? $options['params'] : array();
        unset($options['params']);


        if (isset($options['options']))
            // We get bind context below; so unset here
            /** @see self::getItterator() */
            unset($options['options']);

        $options = array(
            $this->getWrapperName() => $options,
        );

        $bindOptions = $this->_getBindContextOptions();
        $options     = array_merge($bindOptions, $options);

        $context = stream_context_create($options, $params);
        return $context;
    }
645606
function error () {
  if (mocking) {
    cli.stderr += stripAnsi(concatArguments(arguments) + '\n')
  } else {
    console.error.apply(null, arguments)
  }
}
114226
function handleError(e, done) {
    if(this.defaultValue) return done(null, this.defaultValue);
    if(this[defaultError]) return done(this[defaultError]);
    done(e);
  }
1182950
def set_error_callback(cbfun):
    '''
    
    '''
    global _error_callback
    previous_callback = _error_callback
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWerrorfun(cbfun)
    _error_callback = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetErrorCallback(cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
860641
function handleError(err, getContext, lax) {

    var ctx = getContext();

    var line = ctx.line,
        column = ctx.column,
        data = ctx.data;

    // we receive the full context data here,
    // for elements trim down the information
    // to the tag name, only
    if (data.charAt(0) === '<' && data.indexOf(' ') !== -1) {
      data = data.slice(0, data.indexOf(' ')) + '>';
    }

    var message =
      'unparsable content ' + (data ? data + ' ' : '') + 'detected\n\t' +
        'line: ' + line + '\n\t' +
        'column: ' + column + '\n\t' +
        'nested error: ' + err.message;

    if (lax) {
      context.addWarning({
        message: message,
        error: err
      });

      return true;
    } else {
      throw error(message);
    }
  }
415257
protected Error prepareError(int statusCode, RouteContext routeContext) {
        String messageKey = "pippo.statusCode" + statusCode;

        Error error = new Error();
        error.setStatusCode(statusCode);
        error.setStatusMessage(application.getMessages().get(messageKey, routeContext));
        error.setRequestMethod(routeContext.getRequestMethod());
        error.setRequestUri(routeContext.getRequestUri());
        error.setStacktrace(routeContext.getLocal(STACKTRACE));
        error.setMessage(routeContext.getLocal(MESSAGE));

        return error;
    }
1163952
function(args, ce) {
        var c = this.context,
            ret = true;

        if (!c) {
            c = (ce.contextFn) ? ce.contextFn() : ce.context;
        }

        // only catch errors if we will not re-throw them.
        if (Y.config.throwFail) {
            ret = this._notify(c, args, ce);
        } else {
            try {
                ret = this._notify(c, args, ce);
            } catch(e) {
                Y.error(this + ' failed: ' + e.message, e);
            }
        }

        return ret;
    }
243589
function CallContext(msg, channel) {
  this.channel = channel;
  this.locals = {};
  this.message = msg;
  Object.freeze(this);
}
1036505
public void setError(StanzaError.Builder xmppErrorBuilder) {
        if (xmppErrorBuilder == null) {
            return;
        }
        xmppErrorBuilder.setStanza(this);
        error = xmppErrorBuilder.build();
    }
702199
protected void setError(int newPosition, String error,
      boolean currentExisting) {
    if (!currentExisting) {
      newFullValueList[newPosition] = operations.createVector1(0);
    }
    newErrorNumber[newPosition]++;
    if (newErrorList[newPosition].containsKey(error)) {
      newErrorList[newPosition].put(error,
          newErrorList[newPosition].get(error) + 1);
    } else {
      newErrorList[newPosition].put(error, 1);
    }
  }