Class: GoogleAPIErrorHandler

GoogleAPIErrorHandler

WPGMZA.GoogleAPIErrorHandler

new GoogleAPIErrorHandler()

This class catches Google Maps API errors and presents them in a friendly manner, before sending them on to the consoles default error handler.

Methods


addErrorMessage(message [, urls])

Called by onErrorMessage when a Google Maps API error is picked up, this will add the specified message to the Maps API error message dialog, along with URLs to compliment it. This function ignores duplicate error messages.
Parameters:
Name Type Argument Description
message string The message, or part of the message, intercepted from the console
urls array <optional>
An array of URLs relating to the error message to compliment the message.

onErrorMessage(message)

Overrides console.error to scan the error message for Google Maps API error messages.
Parameters:
Name Type Description
message string The error message passed to the console