Add handler for dispatch.error event