More descriptive JavaScript console error messages



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.
Error_message.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.
JS Console error message.png

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

I’ve been a Technical Solutions Engineer at Google for 6 years. I enjoy working on the Google Maps APIs because there is always a new discovery on maps. Outside of Google, I love beer, especially after skiing in the mountains.
mizba.jpeg