* @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * */ namespace PaypalAddons\classes; use Exception; /** * Class PaypalException * Custom exception with additional long message parameter * @package PaypalAddons\classes */ class PaypalException extends Exception { /** @var string Long detailed error message */ private $message_long; /** * PaypalException constructor. * Redefine the exception construct so add long message * @param int $code * @param string $message not required * @param string $message_long not required */ public function __construct($code = 0, $message = '', $message_long = '') { $this->message_long = $message_long; // make sure everything is assigned properly parent::__construct($message, $code); } /** * @return string */ public function getMessageLong() { return $this->message_long; } /** * custom string representation of object */ /*public function __toString() { $paypal = Module::getInstanceByName('paypal'); $error_msg = $this->code ? '['.$this->code.'] ' : ''; $error_msg .= $this->message ? $this->message : ''; $error_msg .= '
'; $error_msg .= $this->message_long ? $this->message_long : ''; return $error_msg."\n"; }*/ }