QuickPay_Exception

The WooCommerce QuickPay QuickPay Exception class.

Defined (1)

The class is defined in the following location(s).

/classes/woocommerce-quickpay-exceptions.php  
  1. class QuickPay_Exception extends Exception 
  2. /** 
  3. * Contains a log object instance 
  4. * @access protected 
  5. */ 
  6. protected $log; 
  7.  
  8. /** 
  9. * Contains the curl object instance 
  10. * @access protected 
  11. */  
  12. protected $curl_request_data; 
  13.  
  14. /** 
  15. * Contains the curl url 
  16. * @access protected 
  17. */  
  18. protected $curl_request_url; 
  19.  
  20. /** 
  21. * Contains the curl response data 
  22. * @access protected 
  23. */  
  24. protected $curl_response_data; 
  25.  
  26.  
  27. /** 
  28. * __Construct function. 
  29. *  
  30. * Redefine the exception so message isn't optional 
  31. * @access public 
  32. * @return void 
  33. */  
  34. public function __construct($message, $code = 0, Exception $previous = null, $curl_request_url = '', $curl_request_data = '', $curl_response_data = '') { 
  35. // make sure everything is assigned properly 
  36. parent::__construct($message, $code, $previous); 
  37.  
  38. $this->log = new WC_QuickPay_Log(); 
  39.  
  40. $this->curl_request_data = $curl_request_data; 
  41. $this->curl_request_url = $curl_request_url; 
  42. $this->curl_response_data = $curl_response_data; 
  43.  
  44.  
  45. /** 
  46. * write_to_logs function. 
  47. *  
  48. * Stores the exception dump in the WooCommerce system logs 
  49. * @access public 
  50. * @return void 
  51. */  
  52. public function write_to_logs()  
  53. $this->log->separator(); 
  54. $this->log->add( 'QuickPay Exception file: ' . $this->getFile() ); 
  55. $this->log->add( 'QuickPay Exception line: ' . $this->getLine() ); 
  56. $this->log->add( 'QuickPay Exception code: ' . $this->getCode() ); 
  57. $this->log->add( 'QuickPay Exception message: ' . $this->getMessage() ); 
  58. $this->log->separator(); 
  59.  
  60.  
  61. /** 
  62. * write_standard_warning function. 
  63. *  
  64. * Prints out a standard warning 
  65. * @access public 
  66. * @return void 
  67. */  
  68. public function write_standard_warning() 
  69. {  
  70. printf(  
  71. wp_kses(  
  72. __( "An error occured. For more information check out the <strong>%s</strong> logs inside <strong>WooCommerce -> System Status -> Logs</strong>.", 'woo-quickpay' ), array( 'strong' => array() )  
  73. ),  
  74. $this->log->get_domain()  
  75. );