Skip to content

Commit b3250c8

Browse files
committed
fix: Displayed remote actor errors better
1 parent 519b131 commit b3250c8

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/firefox/remote.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export class RemoteFirefox {
5454
{to: addon.actor, type: request}, (response) => {
5555
if (response.error) {
5656
reject(
57-
new WebExtError(`${request} response error: ${response.error}`));
57+
new WebExtError(`${request} response error: ` +
58+
`${response.error}: ${response.message}`));
5859
} else {
5960
resolve(response);
6061
}

tests/test-firefox/test.remote.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ describe('firefox.remote', () => {
101101
it('throws when add-on actor requests fail', () => {
102102
const addon = fakeAddon();
103103
const client = fakeFirefoxClient({
104-
makeRequestError: 'some actor request failure',
104+
makeRequestError: {
105+
error: 'unknownError',
106+
message: 'some actor failure',
107+
},
105108
});
106109

107110
const conn = makeInstance(client);
@@ -110,7 +113,7 @@ describe('firefox.remote', () => {
110113
.catch(onlyInstancesOf(WebExtError, (error) => {
111114
assert.equal(
112115
error.message,
113-
'requestTypes response error: some actor request failure');
116+
'requestTypes response error: unknownError: some actor failure');
114117
}));
115118
});
116119
});

0 commit comments

Comments
 (0)