Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm seeing an error message in FireBug:

Error: Internal kml parser error.
Line 34

I'm not worried about fixing this error for the moment - I'd like to know how can I trap the error, so I can report it to the user elegantly? Eg, if they're not using Firebug I'd still like them to know that there's a problem.

The map has an onLayersAddResult event, which contains an Error handler. Is there a similar map-level error handling event which would trap the above KML parser error (and any other errors which might be generated by the API)?

It seems like the map object needs a generic onError() event, but I can't see anything suitable.


share|improve this question
It looks like that error is coming from Firefox itself. It's getting passed bad KML (or so it thinks) so I don't think you're going to be able to trap that. – Mintx Nov 14 '12 at 16:30
@Mintx maybe this is a question for a web/browser group rather than GIS specifically? Thanks – Stephen Lead Nov 14 '12 at 21:06
up vote 2 down vote accepted

Just to address the GIS question specifically, from what I've seen, trapping errors usually consists of extensive try/catches or fetching the JSON response and parsing it before sending it to your functions and catching errors that way. ESRI is slowing coming around to adding error events in their API.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.