Returns and emits error on error to allow error handling when chaining tasks