Catching a basemap gallery layer error

Discussion created by tligon on May 7, 2014
If the first basemap layer in the basemap gallery fails to load (service is down, e.g.), the map is invalid until you switch to another basemap or the user refreshes after the map service is repaired. Is there a way to catch this error beforehand? That way, a method can be written to iterate through the basemap gallery until a valid basemap is located.