public function error($code, $message, $extra = [])
    {
        $response['success'] = false;
        $this->extra($extra);
        if (!in_array($code, array_keys($this->errors))) {
            $code = 500;
        }
        $response['error']['code'] = $code;
        $this->header($this->errors[$code]);
        $response['error']['status'] = $this->errors[$code];
        $response['error']['message'] = $message;
        return $this->output($response);
    }
public function error($code, $message, $extra = [])
    {
        $response['success'] = false;
        $this->extra($extra);
        if (!in_array($code, array_keys($this->errors))) {
            $code = 500;
        }
        $response['error']['code'] = $code;
        $this->header($this->errors[$code]);
        $response['error']['status'] = $this->errors[$code];
        $response['error']['message'] = $message;
        return $this->output($response);
    }
public function error ( $ code , $ message , $ extra = [ ] ) { $ response [ 'success' ] = false ; $ this -> extra ( $ extra ) ; if ( ! in_array ( $ code , array_keys ( $ this -> errors ) ) ) { $ code = 500 ; } $ response [ 'error' ] [ 'code' ] = $ code ; $ this -> header ( $ this -> errors [ $ code ] ) ; $ response [ 'error' ] [ 'status' ] = $ this -> errors [ $ code ] ; $ response [ 'error' ] [ 'message' ] = $ message ; return $ this -> output ( $ response ) ; }
Sets an error header and echoes out the response

@param int $code Error code
@param string $message Error message
@return string HTTP Response
Sets an error header and echoes out the response