Error messages in GitKit Javascript widget

108 views
Skip to first unread message

Brian Chapman

unread,
Feb 25, 2015, 5:54:08 PM2/25/15
to google-iden...@googlegroups.com
I'm using the GitKit javascript widget to change the email address (?mode=manageAccount). When I attempted to change the email address, the widget stalled with a spinner icon. 

The browser console indicated the following error "Uncaught Error: Invalid JSON string: {"error": EMAIL_EXISTS }", which makes since and is correct. 

How do I intercept this error message, cancel the current gitkit operation and display a useful message to the user?

Thanks, Brian.

Mengcheng Duan

unread,
Feb 25, 2015, 6:15:07 PM2/25/15
to google-iden...@googlegroups.com
the response from your endpoint need to be a valid json object, e.g., {"error": "EMAIL_EXISTS"}.
did your server generate the responses or one of our server side libraries? If it's our library, please let us know which one you're using and we'll make a fix.


- Mengcheng

--
You received this message because you are subscribed to the Google Groups "Google Identity Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-identity-t...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jin Liu

unread,
Feb 25, 2015, 7:30:12 PM2/25/15
to google-iden...@googlegroups.com
If you are using the Google Identity Toolkit Java client library, please sync to the latest version 1.2, where this bug was fixed.


On Wednesday, February 25, 2015 at 3:15:07 PM UTC-8, Mengcheng Duan wrote:
the response from your endpoint need to be a valid json object, e.g., {"error": "EMAIL_EXISTS"}.
did your server generate the responses or one of our server side libraries? If it's our library, please let us know which one you're using and we'll make a fix.


- Mengcheng

On Wed, Feb 25, 2015 at 2:54 PM, Brian Chapman wrote:
I'm using the GitKit javascript widget to change the email address (?mode=manageAccount). When I attempted to change the email address, the widget stalled with a spinner icon. 

The browser console indicated the following error "Uncaught Error: Invalid JSON string: {"error": EMAIL_EXISTS }", which makes since and is correct. 

How do I intercept this error message, cancel the current gitkit operation and display a useful message to the user?

Thanks, Brian.

--
You received this message because you are subscribed to the Google Groups "Google Identity Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-identity-toolkit+unsub...@googlegroups.com.

Brian Chapman

unread,
Feb 25, 2015, 8:26:50 PM2/25/15
to google-iden...@googlegroups.com
I upgraded our Google Identity Toolkit Client Library to version 1.2 and yes that did fix the problem. However the message is a bit generic

"Request failed. Please try again.  Dismiss"

It doesn't indicate to the end user why it failed. Is this intentional to not expose the existence of an email address on the system or could the error message be improved?

Thanks for the help!

Jin Liu

unread,
Feb 26, 2015, 2:15:59 AM2/26/15
to google-iden...@googlegroups.com
Hi Brian,

Yes, there has been some consideration of what error messages are meaningful to end users. I think in this case we could give a more clear message to guide the user. We will take the issue into consideration when planning the development efforts.

Thanks,
Jin

Roger Masse

unread,
Mar 11, 2016, 1:43:03 AM3/11/16
to Google Identity Toolkit
I came across this thread with the same problem.  With a local copy of gitkit.js the modification seems pretty straightforward. Display a different error in the case of 'EMAIL_EXISTS'.

6298c6298,6302

<                             c && c.success ? Am(a, b, t(e)) : d.showInfoBar("Request failed. Please try again.")

---

>                             var errorMessage = "Request failed. Please try again.";

>                             if (c && c.error && c.error == 'EMAIL_EXISTS') {

>                                 errorMessage = "That Email exists. If it's yours, signout and sign in using it.";

>                             };

>                             c && c.success ? Am(a, b, t(e)) : d.showInfoBar(errorMessage)


I'm guessing Google does not recommend the approach of a local copy of gitkit.js however...

   -Roger
Reply all
Reply to author
Forward
0 new messages