Skip to content

Commit

Permalink
fix: Displayed remote actor errors better
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Jun 10, 2016
1 parent 519b131 commit b3250c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/firefox/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export class RemoteFirefox {
{to: addon.actor, type: request}, (response) => {
if (response.error) {
reject(
new WebExtError(`${request} response error: ${response.error}`));
new WebExtError(`${request} response error: ` +
`${response.error}: ${response.message}`));
} else {
resolve(response);
}
Expand Down
7 changes: 5 additions & 2 deletions tests/test-firefox/test.remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ describe('firefox.remote', () => {
it('throws when add-on actor requests fail', () => {
const addon = fakeAddon();
const client = fakeFirefoxClient({
makeRequestError: 'some actor request failure',
makeRequestError: {
error: 'unknownError',
message: 'some actor failure',
},
});

const conn = makeInstance(client);
Expand All @@ -110,7 +113,7 @@ describe('firefox.remote', () => {
.catch(onlyInstancesOf(WebExtError, (error) => {
assert.equal(
error.message,
'requestTypes response error: some actor request failure');
'requestTypes response error: unknownError: some actor failure');
}));
});
});
Expand Down

0 comments on commit b3250c8

Please sign in to comment.