diff --git a/src/service/execution.ts b/src/service/execution.ts index a68a49c4..155abda7 100644 --- a/src/service/execution.ts +++ b/src/service/execution.ts @@ -59,7 +59,8 @@ export async function executeOperation( result.success = true; } catch (e) { - logDb(`Error caught for connection ${connectionId}:`, e); + logDb(`Error caught for connection ${connectionId}:`); + result.error = e; } @@ -77,7 +78,7 @@ export async function executeOperation( if (result.error) { logDb('Result:\n%O', result); - throw result.error; + throw { result }; } return result; diff --git a/src/util/promise.ts b/src/util/promise.ts index 1774821a..042b0de4 100644 --- a/src/util/promise.ts +++ b/src/util/promise.ts @@ -25,7 +25,11 @@ export async function runSequentially(promisers: Promiser[]): Promise result.push(value); } catch (err) { - throw err; + if (!err.result) { + throw err + } + + result.push(err.result) } }