KAA-42: Add handling of client session expiration with optional redirection to login page.

I propose a bit more effective way:

        String errorMessage = caught.getMessage();

        int leftSquareBracketIndex = errorMessage.indexOf(LEFT_SQUARE_BRACKET);
        int rightSquareBracketIndex = -1;

        if (leftSquareBracketIndex != -1) {
            rightSquareBracketIndex = errorMessage.indexOf(RIGHT_SQUARE_BRACKET);
        }

        if (rightSquareBracketIndex != -1) {
            StringBuilder builder = new StringBuilder();
            builder.append("Incorrect json schema: Please check your schema at");
            String[] array = errorMessage.substring(leftSquareBracketIndex, rightSquareBracketIndex).split(SEMICOLON);
            if (array != null && array.length == 2) {
                builder.append(array[1]);
                errorMessage = builder.toString();
            }
        } else {
            return "Incorrect schema: Please validate your schema.";
        }
        return errorMessage;