public static function factory($type = '', $message = '', $code = 0, Exception $previous = null)
    {
        if (file_exists(__DIR__ . ucfirst($type) . 'Exception.php')) {
            include_once __DIR__ . ucfirst($type) . 'Exception.php';
            $classname = 'Whoisdoma\DomainParser\Exception\\' . ucfirst($type) . 'Exception';
            return new $classname($message, $code, $previous);
        } else {
            include_once __DIR__ . '/Exception.php';
            $classname = 'Whoisdoma\DomainParser\Exception\Exception';
            return new $classname($message, $code, $previous);
        }
    }