From 2dfb3146b00f8d5264dc72b416754c6e7966c3fe Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 2 May 2018 10:39:15 +0100 Subject: [PATCH] Simplify concurrent request error handling --- src/stores/GroupStore.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 0e2e8e6b86..e7cea5667e 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -56,22 +56,16 @@ async function limitConcurrency(fn) { }); } - let result; - let error; - ongoingRequestCount++; try { - result = await fn(); + return await fn(); } catch (err) { - error = err; + // We explicitly do not handle the error here, but let it propogate. + throw err; } finally { ongoingRequestCount--; checkBacklog(); } - - if (error) throw error; - - return result; } /**