Handle java 'error' event