summaryrefslogtreecommitdiff
path: root/test/parallel/test-event-emitter-errors.js
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2015-05-07 16:09:31 -0500
committerEvan Lucas <evanlucas@me.com>2015-05-12 08:33:20 -0500
commit8b9a1537ad5c34c92215660291e962558b6bc8d3 (patch)
tree81c3e6200c1b692cbcdcb2273ea94f24a053ce9f /test/parallel/test-event-emitter-errors.js
parent08d08668c957d990e0c52b733e3b29d939a61113 (diff)
downloadandroid-node-v8-8b9a1537ad5c34c92215660291e962558b6bc8d3.tar.gz
android-node-v8-8b9a1537ad5c34c92215660291e962558b6bc8d3.tar.bz2
android-node-v8-8b9a1537ad5c34c92215660291e962558b6bc8d3.zip
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>
Diffstat (limited to 'test/parallel/test-event-emitter-errors.js')
-rw-r--r--test/parallel/test-event-emitter-errors.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-event-emitter-errors.js b/test/parallel/test-event-emitter-errors.js
new file mode 100644
index 0000000000..5ee2c87052
--- /dev/null
+++ b/test/parallel/test-event-emitter-errors.js
@@ -0,0 +1,8 @@
+var EventEmitter = require('events');
+var assert = require('assert');
+
+var EE = new EventEmitter();
+
+assert.throws(function() {
+ EE.emit('error', 'Accepts a string');
+}, /Accepts a string/);