Skip to content
Products
Solutions
By industry
By use case
Resources
Products
Solutions
By industry
By use case
Resources
Products
Solutions
By industry
By use case
Resources
More descriptive JavaScript console error messages
Kosuke Mizubayashi
Technical Solutions Engineer at Google
Jun 16, 2016
Try Google Maps Platform
Unlock access to real-world data and insights with a monthly $200 Google Maps Platform credit.
Get started

Over the past few months we've rolled out several JavaScript console error message improvements designed to help developers implement Google Maps JavaScript API into web apps. Our goal was to:

  • Give developers more descriptive error messages

  • Provide developers with a suggested solution to resolve the error

  • Avoid popups for displaying error messages

  • Create a positive experience for end-users in the event an error occurs

_How do developers usually use the JavaScript console? When? Why?_Web developers use browser tools to develop and debug their applications. They can find various messages in the JavaScript console to which their application, libraries or APIs write. For users of our Google Maps JavaScript API, we have returned error messages in the JavaScript console for some types of Maps API errors. But, these messages were often not descriptive enough for web developers to investigate the issue and find solutions.

_What happened when users saw the old error messages?_Our previous popup error messages showed up on the top of the web page. This JavaScript alert prevented users from interacting with the page until the “OK” button was clicked, even if they were not interacting with the map. We served 4 basic error messages that pointed to the general troubleshooting page of our website.

NmSY8yUacuew5YMC3ppa2Qi7DMNY0wKcxaPpkXni5WE02WCJSHqu-79gg2SY9B7SBW3EyTcAIci32fxqEsPmLdJkCFI2ePqFhGiQEJzYS73Qe_3h3R9OZXQUgEgu3lXDF8I5ZGZpai8r.PNG

_What do developers and users see now?_We now display 21 different error messages in the console —you can see the full list in our developer documentation. In addition, we've provided direct links from specific errors to self-service solutions on the developer site. We've also simplified the error messages displayed to end users -the improved error appears in the map div itself, allowing users to interact with the rest of the page even if the map load fails.

iEk9yiijP-HJWPDltbINVIhT3mgjZcEhqRnGV1-kQMX26ZNgAFYMhPKj_emWcYBVSyfAAuqbPHhL3SHvFcfUsWmd06TAVz9o8rlY6MxNBfkoKFGdVY1SA0GY-zhLurtd6_TpFIOcnmw8.PNG

We hope these changes will improve your implementation and interactions with your end users.

Clay cityscape
Clay cityscape
Google Maps Platform
Get going with Google Maps Platform