Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/StoreApi/Exceptio...
File: RouteException.php
<?php
[0] Fix | Delete
namespace Automattic\WooCommerce\StoreApi\Exceptions;
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* RouteException class.
[4] Fix | Delete
*/
[5] Fix | Delete
class RouteException extends \Exception {
[6] Fix | Delete
/**
[7] Fix | Delete
* Sanitized error code.
[8] Fix | Delete
*
[9] Fix | Delete
* @var string
[10] Fix | Delete
*/
[11] Fix | Delete
public $error_code;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Additional error data.
[15] Fix | Delete
*
[16] Fix | Delete
* @var array
[17] Fix | Delete
*/
[18] Fix | Delete
public $additional_data = [];
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Setup exception.
[22] Fix | Delete
*
[23] Fix | Delete
* @param string $error_code Machine-readable error code, e.g `woocommerce_invalid_product_id`.
[24] Fix | Delete
* @param string $message User-friendly translated error message, e.g. 'Product ID is invalid'.
[25] Fix | Delete
* @param int $http_status_code Proper HTTP status code to respond with, e.g. 400.
[26] Fix | Delete
* @param array $additional_data Extra data (key value pairs) to expose in the error response.
[27] Fix | Delete
*/
[28] Fix | Delete
public function __construct( $error_code, $message, $http_status_code = 400, $additional_data = [] ) {
[29] Fix | Delete
$this->error_code = $error_code;
[30] Fix | Delete
$this->additional_data = array_filter( (array) $additional_data );
[31] Fix | Delete
parent::__construct( $message, $http_status_code );
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* Returns the error code.
[36] Fix | Delete
*
[37] Fix | Delete
* @return string
[38] Fix | Delete
*/
[39] Fix | Delete
public function getErrorCode() {
[40] Fix | Delete
return $this->error_code;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Returns additional error data.
[45] Fix | Delete
*
[46] Fix | Delete
* @return array
[47] Fix | Delete
*/
[48] Fix | Delete
public function getAdditionalData() {
[49] Fix | Delete
return $this->additional_data;
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function