Stream error handling

I am using got to stream a request. New to streams, I am not sure what the best way to deal with errors is. Specifically this request might send a 403, which I would like to catch, and not pipe the response if there is an error.

got.stream(url)
.on("error", (e) => {
console.log(e)
})
.pipe(res)

In this example, the response will still get piped to

res

even if the response returned a

403

. What is the right way to keep the response from being piped, or is there a better or more idiomatic way to go about this?