Skip to content

Commit b7332a2

Browse files
committed
inline
1 parent 58d605f commit b7332a2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/client.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,9 @@ function postReplyWith(client, key, msg) {
141141
return when(client._messageHandlers[key]).then(
142142
rawPostMessage.bind(null, client, msg)
143143
).catch(function(reason) {
144-
var rejectMessage;
145144
// if the handler throws an error we want to send back its message, but
146145
// Error objects don't pass through the postMessage boundary.
147-
if (reason instanceof Error) {
148-
rejectMessage = reason.message;
149-
} else {
150-
rejectMessage = reason;
151-
}
146+
var rejectMessage = reason instanceof Error ? reason.message : reason;
152147
msg.error = {
153148
msg: rejectMessage
154149
};

0 commit comments

Comments
 (0)