Skip to content

Commit

Permalink
fix: only handle Error instances specially
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Mar 17, 2020
1 parent 2f68914 commit f82558d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/SwingSet/src/devices/command-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export default function setup(syscall, state, helpers, endowments) {
},

sendResponse(count, isReject, obj) {
if (isReject) {
if (isReject && obj instanceof Error) {
console.log('inboundHandler rejected with:', obj);
obj = `${obj}`;
obj = { message: obj.message };
}
try {
deliverResponse(count, isReject, JSON.stringify(obj));
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/test/test-devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ async function testCommandDeliver(t, withSES) {
t.end();
}

test('command deliver without SES', async t => {
test.only('command deliver without SES', async t => {
await testCommandDeliver(t, false);
});

Expand Down

0 comments on commit f82558d

Please sign in to comment.