Skip to content

Instantly share code, notes, and snippets.

@toddrbryan
Created January 16, 2014 18:23
Show Gist options
  • Save toddrbryan/8460378 to your computer and use it in GitHub Desktop.
Save toddrbryan/8460378 to your computer and use it in GitHub Desktop.
# emit one error event if the sax parser fails. this is mostly a hack, but
# the sax parser isn't state of the art either.
err = false
@saxParser.onerror = (error) =>
@saxParser.resume() #Added
if ! err
err = true
@emit "error", error
@saxParser.onend = () => @emit "end" #Added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment