only handle the first emit `error`