Fixed error event to pass error object
- #2345