function output_error($error) { if (function_exists('bump_stats_extra')) { $client_id = !empty($this->token_details['client_id']) ? $this->token_details['client_id'] : 0; bump_stats_extra('rest-api-errors', $client_id); } $error_response = $this->serializable_error($error); return $this->output($error_response['status_code'], $error_response['errors']); }
function output_error($error) { if (function_exists('bump_stats_extra')) { bump_stats_extra('rest-api-errors', $this->token_details['client_id']); } $status_code = $error->get_error_data(); if (is_array($status_code)) { $status_code = $status_code['status_code']; } if (!$status_code) { $status_code = 400; } $response = array('error' => $error->get_error_code(), 'message' => $error->get_error_message()); return $this->output($status_code, $response); }