/var/www/html_uk/wp-content/plugins/automatewoo/includes/Rest_Api/Utilities/RestException.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace AutomateWoo\Rest_Api\Utilities;

use 
WC_REST_Exception;
use 
WP_Error;

/**
 * Class RestException
 *
 * @since   5.0.0
 * @package AutomateWoo\Rest_Api\Utilities
 */
class RestException extends WC_REST_Exception {

    
/**
     * Get the WP_Error equivalent of the Exception.
     *
     * @return WP_Error
     */
    
public function get_wp_error() {
        return new 
WP_Error$this->getErrorCode(), $this->getMessage(), $this->getErrorData() );
    }
}