event 'unexpected error' got an error code
event 'unexpected error' got an error code

- fixed error handling