public static function getCodeByMessage(string $errorMessage): int
    {
        $code = array_search($errorMessage, self::MESSAGES);
        if ($code === false) {
            $code = self::UNKNOWN_ERROR;
        }
        return (int)$code;
    }