Added possibility to listen and push error events.