Channel.select: Reword error message.

This commit is contained in:
David Braun 2017-10-18 14:51:56 -04:00
parent b9901df29a
commit 32af6e8987
2 changed files with 2 additions and 2 deletions

View file

@ -353,13 +353,13 @@ Channel.select = methodPromises =>
await promise; await promise;
} catch (exception) { } catch (exception) {
reject(exception); reject(exception);
`Channel.select accepts only promises returned by push & shift.`
} }
resolve(promise.channel); resolve(promise.channel);
} catch (exception) { } catch (exception) {
reject( reject(
new TypeError( new TypeError(
`Channel.select accepts only Channel method promises.`
) )
); );
} }

View file

@ -122,7 +122,7 @@ describe(`Channel`, function() {
it(`complains when given non-channel method promises`, function() { it(`complains when given non-channel method promises`, function() {
assertRejects(async () => { assertRejects(async () => {
await Channel.select([Promise.resolve()]); await Channel.select([Promise.resolve()]);
}, new TypeError(`Channel.select accepts only Channel method promises.`)); }, new TypeError(`Channel.select accepts only promises returned by push & shift.`));
}); });
}); });