# ali2woo-lite/trunk/includes/classes/exception/FactoryException.php

AliNext – WooCommerce Dropshipping Plugin for AliExpress, version trunk. 30 lines.

- Page: https://pluginprobe.com/plugins/ali2woo-lite/trunk/code/includes/classes/exception/FactoryException.php
- Raw: https://pluginprobe.com/plugins/ali2woo-lite/trunk/raw/includes/classes/exception/FactoryException.php
- Modified: 2024-07-03T15:07:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ali2woo-lite/trunk/code/includes/classes/exception/FactoryException.php#L10-L20`.

```php
<?php
namespace AliNext_Lite;;

use Exception;
use Throwable;

class FactoryException extends Exception
{
    protected ?array $extraData = null;

    public function __construct($message, ?array $extraData = null, int $code = 0, Throwable $previous = null) {
        parent::__construct($message, $code, $previous);
    }

    public function __toString() {
        if ($this->extraData) {
            return __CLASS__ . ": [{$this->code}]: {$this->message} \n [Extra data]: "
                . print_r($this->extraData, true) . "\n";
        } else {
            return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
        }
    }

    public function getExtraData(): ?array
    {
        return $this->extraData;
    }

}

```
