<?php

namespace Wetail\Shipping\Engine;

use Throwable;

if ( ! defined( 'ABSPATH' ) ) {
	die();
}


/**
 * Custom exception class for handling shipping-related exceptions.
 * Extends the base Exception class to include additional response data.
 *
 * @param string $message The error message
 * @param mixed|null $responseData Additional response data associated with the exception
 * @param int $code The error code
 * @param Throwable|null $previous Previous throwable used for exception chaining
 */
class Wetail_Shipping_Exception extends \Exception {
	private $responseData;

	public function __construct($message, $responseData = null, $code = 0, Throwable $previous = null) {
		parent::__construct($message, $code, $previous);
		$this->responseData = $responseData;
	}

	public function getResponseData() {
		return $this->responseData;
	}

}
