0

I am writing a small application that lets the user get a spreadsheet from his Google docs. I am making a log-in Form that requests a email address and name, and then tries to connect to Google, and to check if the account that was entered is real.

I'm using the spreadsheet API, and there is a class called SpreadsheetsService but it doesn't have any status property; it just throws an exception when I enter a wrong account name.

My questions: Is there a library that returns a Status code for this situation?

Should I check the class SpreadsheetsService and check if an exception was thrown? (I have to use a function from this class to produce this)

Bobson
  • 13,498
  • 5
  • 55
  • 80
samy
  • 1,949
  • 6
  • 39
  • 64
  • 1
    Google won't tell you if it's real or not. You just have to send it and hope it is. Think about the spamming repercussions if they did verify email addresses. – Austin Salonen Dec 14 '12 at 16:34
  • yeah that make sense, so should i just check if i get any spreadsheet return to me when i call it? (this is only way to check if an execption was thrown) – samy Dec 14 '12 at 16:38

1 Answers1

1
bool isValid()
{
    try
    {
       connect();
    }
    catch
    {
       return false;
    }

    return true;
}
dferraro
  • 6,357
  • 11
  • 46
  • 69