fail, alias of error()

@param  mixed $errcode
@param  mixed $errmsg
@param  array $data
@return ResponseInterface
175397
protected function fail($errcode=-1, $errmsg=null, $data=null)
    {
        return static::error($errcode, $errmsg, $data);
    }
356075
protected function success($errmsg=null, $data=null)
    {
        $this->errorInfo = ErrorInfo::success($errmsg, $data);
        
        if (!isset($this->errorInfo['errmsg'])) {
            $this->errorInfo['errmsg'] = '操作成功';
        }
        
        return $this->jump($this->errorInfo);
    }
1028905
public function error($message, $data = null, $code = 404) {
		$this->_status = static::STATUS_FAIL;
		$this->_message = $message;
		$this->_data = !$data && $data !== false ? null : $data;
		$this->_code = $code;
	}
1117416
function _errorHandler($errNo, $errMsg, $errFile, $errLine, $errCont)
    {
        $errType = $this->_getErrorTypes();

        $errorMessage = $errType[$errNo] . "\t\"" . trim($errMsg) . "\"\t" . $errFile . ' ' . 'Line:' . $errLine;

        if (self::$_config['errors']['logAll']) {
            error_log('JBDump:' . $errorMessage);
        }

        if (!(error_reporting() & $errNo) || error_reporting() == 0 || (int)ini_get('display_errors') == 0) {

            if (self::$_config['errors']['logHidden']) {
                $errorMessage = date(self::DATE_FORMAT, time()) . ' ' . $errorMessage . PHP_EOL;

                $logPath = self::$_config['log']['path']
                    . '/' . self::$_config['log']['file'] . '_error_' . date('Y.m.d') . '.log';

                error_log($errorMessage, 3, $logPath);
            }

            return false;
        }


        $errFile = $this->_getRalativePath($errFile);
        $result  = array(
            'file'    => $errFile . ' : ' . $errLine,
            'type'    => $errType[$errNo] . ' (' . $errNo . ')',
            'message' => $errMsg,
        );

        if (self::$_config['errors']['context']) {
            $result['context'] = $errCont;
        }

        if (self::$_config['errors']['errorBacktrace']) {
            $trace = debug_backtrace();
            unset($trace[0]);
            $result['backtrace'] = $this->convertTrace($trace);
        }

        if ($this->_isLiteMode()) {
            $errorInfo = array(
                'message' => $result['type'] . ' / ' . $result['message'],
                'file'    => $result['file']
            );
            $this->_dumpRenderLite($errorInfo, '* ' . $errType[$errNo]);

        } else {
            $desc = '<b style="color:red;">*</b> ' . $errType[$errNo] . ' / ' . $this->_htmlChars($result['message']);
            $this->dump($result, $desc);
        }

        return true;
    }
876486
public function errorHandler($errno, $errstr, $errfile, $errline) {
        $error = sprintf("[%d] (%s)", $errno, $errstr);

        switch ($errno) {
            case E_USER_NOTICE:
                $this->addError($error, $errfile, $errline, ERROR_ERROR, LOG_ERROR);
                break;

            case E_USER_WARNING:
                $this->addError($error, $errfile, $errline, ERROR_ERROR, LOG_ERROR);
                break;

            case E_WARNING:
                $this->addError($error, $errfile, $errline, ERROR_ERROR, LOG_ERROR);
                break;

            case E_USER_ERROR:
                $this->addError($error, $errfile, $errline, ERROR_ERROR, LOG_SYSTEM);
                break;

            default:
                $this->addError($error, $errfile, $errline, ERROR_ERROR, LOG_ERROR);
                break;
        }
    }
1299898
public function handleError($errNumber, $errString, $errFile ='', $errLine = 0)
	{
		$interfaceSettings = $this->cmd->getConfigOpt('interface');
		$textColor = $interfaceSettings['error']['text_color'];
		$textBgColor = $interfaceSettings['error']['text_background'];

		$this->env->sendOutput('Error: ' . $errString, $textColor, $textBgColor);
		exit;
	}
613746
public function logError( $errMsg, $context = null )
    {
        $errMsg = $context != null ? $errMsg . ' - ' . $context : $errMsg;
        error_log( $errMsg );
    }
188661
private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData)
    {
        $msg = isset($errorData['message']) ? $errorData['message'] : null;
        $param = isset($errorData['param']) ? $errorData['param'] : null;
        $code = isset($errorData['code']) ? $errorData['code'] : null;
        $type = isset($errorData['type']) ? $errorData['type'] : null;

        switch ($rcode) {
            case 400:
                // 'rate_limit' code is deprecated, but left here for backwards compatibility
                // for API versions earlier than 2015-09-08
                if ($code == 'rate_limit') {
                    return new Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders);
                }
                if ($type == 'idempotency_error') {
                    return new Error\Idempotency($msg, $rcode, $rbody, $resp, $rheaders);
                }

                // intentional fall-through
            case 404:
                return new Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders);
            case 401:
                return new Error\Authentication($msg, $rcode, $rbody, $resp, $rheaders);
            case 402:
                return new Error\Card($msg, $param, $code, $rcode, $rbody, $resp, $rheaders);
            case 403:
                return new Error\Permission($msg, $rcode, $rbody, $resp, $rheaders);
            case 429:
                return new Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders);
            default:
                return new Error\Api($msg, $rcode, $rbody, $resp, $rheaders);
        }
    }
245978
public function respondWithFailure($code = null, array $data = [], $message = null): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_BAD_REQUEST)->respond([
            'status' => [
                'type' => 'error',
                'message' => $this->getDefaultMessage($code, $message),
                'code' => $code,
                'http_code' => $this->getStatusCode(),
            ],
            'data' => $data,
        ]);
    }
1105559
private function errorResponse($message, $data = [], $status = 400, array $headers = [])
    {
        return new JsonResponse(array_merge(['message' => $message], $data), $status, $headers);
    }
682861
def build_response_error(resposta = {})
      retorno = SuperpayApi::Retorno.new
      retorno.errors.add(:code, resposta.to_hash[:fault][:faultcode]) unless resposta.to_hash[:fault][:faultcode].blank?
      retorno.errors.add(:mensagem, resposta.to_hash[:fault][:faultstring]) unless resposta.to_hash[:fault][:faultstring].blank?
      return retorno
    end
1180693
public function errorHandler($errno, $errstr, $errfile, $errline)
        {
            $errorMsg = $errstr . " (Line: " . $errline . ")";

            if ($errno != E_WARNING && $errno != E_NOTICE && $errno != E_STRICT) {
                throw new Exception($errorMsg, $errno);
            } else {
                return false; // Let PHP handle it
            }
        }
970750
public function return_data($data){

        if (isset($data['errcode']) && $data['errcode'] > 0){
            $this->error = $data['errmsg'];
            return false;
        }else{
            return $data;
        }
    }
611618
public function handle($errno, $errstr, $errfile, $errline)
    {
        if (!$this->processorsStack) {
            return null;
        }

        foreach ($this->processorsStack as $processor) {
            if (!($processor->getErrorTypes() & $errno)) {
                continue;
            }

            $lastResult = $processor->handle($errno, $errstr, $errfile, $errline);
        }

        return isset($lastResult) ? $lastResult : null;
    }
668787
public static function addError($errno, $errstr = '', $errfile = '', $errline = 0)
    {
        $stack = & static::$stack[count(static::$stack) - 1];
        $stack = new ErrorException($errstr, 0, $errno, $errfile, $errline, $stack);
    }
1184802
protected function getError($response_data, $status) {
    if (!empty($response_data->error)) {
      $error = $response_data->error;
      $message = sprintf('%s %s: %s',
        $error->statuscode,
        $error->statusdesc,
        $error->errormessage);
    }
    else {
      $message = sprintf('Error code: %s. No reason was given by Pingdom for the error.', $status);
    }
    return $message;
  }
1040349
public function generateErrorWrapper($errno, $errstr, $errfile, $errline)
    {
        return new ErrorWrapper(
            $errno,
            $errstr,
            $errfile,
            $errline,
            $this->buildErrorTrace($errfile, $errline),
            $this->utilities
        );
    }