Benjamin (Inglor) Gruenbaum (2015-02-03T23:23:11.000Z)
d at domenic.me (2015-02-17T17:58:57.823Z)
Yes, the non-overlapping way to write it IMO would be to isolate the rejection on errors to a function: ``` let watchError = (client) => new Promise((resolve, reject) => client.on("error", reject)); // as a plain promise function fetchish(){ let client = new Client; return Promise.race([watchError(client), client.get()]).then(JSON.parse)); } // as an async function async function fetchish(){ let client = new Client(); let result = await Promise.race([client.get(), watchError(client)]); return JSON.parse(result); } ```