@param string $iso
@return string

@throws \Exception
964198
public function fromIsoToCountry(string $iso)
    {
        switch ($iso) {
            case "pl":
                $country = "Polen";

                break;
            case "de":
                $country = "Deutschland";

                break;
            case "au":
                $country = "Österreich";
                break;

            case "it":
                $country = "Italien";
                break;

            case "un":
                $country = "Ungarn";
                break;

            default:
                throw new \Exception('Country Not Exist, Iso = ' . $iso);
        }

        return $country;
    }
819987
protected function formatException(\Exception $e)
	{
		if ($this->debug)
		{
			$location = $e->getMessage().' in '.$e->getFile().':'.$e->getLine();

			return 'Error in exception handler: '.$location;
		}

		return 'Error in exception handler.';
	}
1309035
private function getMessage(\Exception $exception)
    {
        $message = $exception->getMessage();

        if ($this->isApiException($exception)) {
            $message = $exception->getMessageWithVariables();
        }

        return $message;
    }
1314580
protected function _getMessage(Exception $exception)
    {
        $message = $this->getMessageForException($exception);

        $request = Router::getRequest();
        if ($request) {
            $message .= $this->_requestContext($request);
        }

        return $message;
    }
356665
public function formatException(\Exception $e)
    {
        $message = $e->getMessage();
        if (!$e instanceof PsyException) {
            if ($message === '') {
                $message = \get_class($e);
            } else {
                $message = \sprintf('%s with message \'%s\'', \get_class($e), $message);
            }
        }

        $message = \preg_replace(
            "#(\\w:)?(/\\w+)*/src/Execution(?:Loop)?Closure.php\(\d+\) : eval\(\)'d code#",
            "eval()'d code",
            \str_replace('\\', '/', $message)
        );

        $message = \str_replace(" in eval()'d code", ' in Psy Shell code', $message);

        $severity = ($e instanceof \ErrorException) ? $this->getSeverity($e) : 'error';

        return \sprintf('<%s>%s</%s>', $severity, OutputFormatter::escape($message), $severity);
    }
278240
protected function getStatusCode(\Exception $exception)
    {
        // If matched
        if ($statusCode = $this->exceptionCodes->resolveException($exception)) {
            return $statusCode;
        }

        // Otherwise, default
        if ($exception instanceof HttpExceptionInterface) {
            return $exception->getStatusCode();
        }

        return 500;
    }
511280
public function getFullIsoName(): string
    {
        if (!$this->isoName) {
            $this->isoName = $this->getNames()['isoName'];
        }

        return $this->isoName;
    }
97713
public function getGecos()
    {
        if (!array_key_exists(self::GECOS, $this->passwd)) {
            throw new \Exception('Could not get user gecos from passwd.');
        }
        return $this->passwd[self::GECOS];
    }
349116
public static function getCurrencyId($isoCode)
    {
        $allCurrencies = self::getAll();

        foreach ($allCurrencies as $currency) {
            if (strcasecmp($currency['abbreviation'], $isoCode) === 0) {
                return $currency['id'];
            }
        }
        throw new NotFound('Currency', $isoCode);
    }
1080536
public static function getMessageFromCode($code)
    {
        if (!array_key_exists($code, self::$responseCodes)) {
            throw new \Exception('The header code '.$code.' is not valid.');
        }

        return self::$responseCodes[$code];
    }
1027377
protected function getFormattedMessageException(\Exception $exception)
    {
        if ($exception instanceof InvalidTypeException) {
            $attribute = $this->getExceptionAttribute($exception->getMessage());
            $attribute = substr($attribute, strrpos($attribute, '.') + 1);
            $message = sprintf('Invalid type for attribute "%s"', $attribute);
            $message .= substr($exception->getMessage(), strrpos($exception->getMessage(), '". ') + 1);

            return $message;
        }

        $attribute = $this->getExceptionAttribute($exception->getMessage());
        $message = sprintf('The attribute "%s" does not exist for the "%s" tag', $attribute, $this->getTag());
        $validNode = $this->getAttributeNodeConfig();

        if ($validNode instanceof ArrayNode) {
            $message .= sprintf('. Only attributes "%s" are available', implode('", "', array_keys($validNode->getChildren())));
        }

        return $message;
    }
480212
public function get($key)
    {
        if (!$this->has($key)) {
            throw new \Exception(sprintf('Identifier "%s" is not defined.', $key));
        }
        try {
            return $this->offsetGet($key);
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
19405
protected function getMessage($request, $exception)
    {
        $message = $this->getMessageForException($exception);

        $message .= "\nRequest URL: " . $request->getRequestTarget();
        $referer = $request->getHeaderLine('Referer');
        if ($referer) {
            $message .= "\nReferer URL: " . $referer;
        }
        $message .= "\n\n";

        return $message;
    }
1092446
protected function exceptionMessage(\Exception $e)
    {
        return get_class($e) . ' in ' . $e->getFile() . ':' . $e->getLine() . ' "' . $e->getMessage() . '"';
    }
382515
protected function _encode(): string
    {
        // json encode
        $data = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

        if ($data === false) {
            throw new \Exception('Invalid data');
        }

        // replace markup by JavacriptFunction
        $data = preg_replace_callback('/"::FUNCTION::(.*?)::FUNCTION::"/', function ($matches) {
            return stripcslashes($matches[1]);
        }, $data);

        return $data;
    }
631268
protected function getStatusCodeFromException(Exception $exception)
    {
        if ($exception instanceof OAuthException) {
            return $exception->httpStatusCode;
        }

        if ($exception instanceof HttpResponseException) {
            return $exception->getResponse()->getStatusCode();
        }

        if ($exception instanceof ValidationException) {
            return 422;
        }

        if (method_exists($exception, 'getStatusCode')) {
            return $exception->getStatusCode();
        }

        return 500;
    }
515671
public function getCurrency($iso)
    {
        return (bool) $this->config('currencies.included', false)
            ? Currencies::load()->get($iso, $iso)
            : $iso;
    }