javascript eventsource error handling