use the error event instead of throwing the error