Skip to content

Commit

Permalink
feat: Allow fetch exceptions to propogate up the stack
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
  • Loading branch information
GordonSmith committed Jan 21, 2025
1 parent ed4453e commit 1ce39f6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 0 additions & 8 deletions packages/comms/src/espConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ export class ESPConnection implements IConnection {
return retVal;
}
return response;
}).catch(e => {
if (e.isESPExceptions) {
throw e;
}
throw new ESPExceptions(action, request, {
Source: "ESPConnection.send",
Exception: [{ Code: 0, Message: e.message }]
});
});
}

Expand Down
4 changes: 1 addition & 3 deletions packages/comms/src/services/wsWorkunits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ export class WorkunitsService extends WorkunitsServiceBase {
}

Ping(): Promise<WsWorkunits.WsWorkunitsPingResponse> {
return this._connection.send("Ping", {}, "json", false, undefined, "WsWorkunitsPingResponse").then((response) => {
return this._connection.send("Ping", {}, "json", false, undefined, "WsWorkunitsPingResponse").then(() => {
return { result: true };
}).catch((e: Error) => {
return { result: false, error: e };
});
}

Expand Down

0 comments on commit 1ce39f6

Please sign in to comment.