Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit fc1c549

Browse files
committed
Display grpc error message on desktop. Closes #1161
1 parent 8cc1d96 commit fc1c549

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/action/grpc.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,13 @@ class GrpcAction {
152152
// Helper functions
153153
//
154154

155-
_sendIpc(event, listen, method, body) {
156-
listen = method ? `${listen}_${method}` : listen;
157-
return this._ipc.send(event, listen, { method, body });
155+
async _sendIpc(event, listen, method, body) {
156+
try {
157+
listen = method ? `${listen}_${method}` : listen;
158+
return await this._ipc.send(event, listen, { method, body });
159+
} catch (err) {
160+
throw new Error(err.details);
161+
}
158162
}
159163
}
160164

test/unit/action/grpc.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe('Action GRPC Unit Tests', () => {
170170
it('should proxy error via ipc', async () => {
171171
ipcRendererStub.once
172172
.withArgs('some-listener_some-method')
173-
.yields(null, { err: new Error('Boom!') });
173+
.yields(null, { err: { details: 'Boom!' } });
174174
await expect(
175175
grpc._sendIpc(event, listen, method, body),
176176
'to be rejected with error satisfying',

0 commit comments

Comments
 (0)