events: provide better error message for unhandled error
authorEvan Lucas <evanlucas@me.com>
Thu, 7 May 2015 21:09:31 +0000 (16:09 -0500)
committerEvan Lucas <evanlucas@me.com>
Tue, 12 May 2015 13:33:20 +0000 (08:33 -0500)
commit8b9a1537ad5c34c92215660291e962558b6bc8d3
tree81c3e6200c1b692cbcdcb2273ea94f24a053ce9f
parent08d08668c957d990e0c52b733e3b29d939a61113
events: provide better error message for unhandled error

Previously, in the event of an unhandled error event, if the error is a
not an actual Error, then a default error is thrown. Now, the argument
is appended to the error message and added as the `context` property
of the error.

PR-URL: https://github.com/iojs/io.js/pull/1654
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
lib/events.js
test/parallel/test-event-emitter-errors.js [new file with mode: 0644]