{"action":"created","issue":{"url":"https://api.github.com/repos/OverZealous/run-sequence/issues/36","labels_url":"https://api.github.com/repos/OverZealous/run-sequence/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/OverZealous/run-sequence/issues/36/comments","events_url":"https://api.github.com/repos/OverZealous/run-sequence/issues/36/events","html_url":"https://github.com/OverZealous/run-sequence/issues/36","id":93223619,"number":36,"title":"strange error handling in nested run-sequence","user":{"login":"ntopia","id":1179792,"avatar_url":"https://avatars.githubusercontent.com/u/1179792?v=3","gravatar_id":"","url":"https://api.github.com/users/ntopia","html_url":"https://github.com/ntopia","followers_url":"https://api.github.com/users/ntopia/followers","following_url":"https://api.github.com/users/ntopia/following{/other_user}","gists_url":"https://api.github.com/users/ntopia/gists{/gist_id}","starred_url":"https://api.github.com/users/ntopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntopia/subscriptions","organizations_url":"https://api.github.com/users/ntopia/orgs","repos_url":"https://api.github.com/users/ntopia/repos","events_url":"https://api.github.com/users/ntopia/events{/privacy}","received_events_url":"https://api.github.com/users/ntopia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-06T08:35:05Z","updated_at":"2015-07-06T13:19:38Z","closed_at":null,"body":"In normal case, nested run-sequence works good.\r\n[source code]\r\n```\r\nvar gulp = require('gulp');\r\nvar runSeq = require('run-sequence');\r\ngulp.task('task-inner', function () {\r\n\t// do nothing\r\n});\r\ngulp.task('task2', function (cb) {\r\n\trunSeq('task-inner', cb);\r\n});\r\ngulp.task('task1', function (cb) {\r\n\trunSeq('task2', cb);\r\n});\r\ngulp.task('default', function (cb) {\r\n\trunSeq('task1', cb);\r\n});\r\n```\r\n[output]\r\n```\r\n[17:22:15] Using gulpfile ~\\xxx\\gulpfile.js\r\n[17:22:15] Starting 'default'...\r\n[17:22:15] Starting 'task1'...\r\n[17:22:15] Starting 'task2'...\r\n[17:22:15] Starting 'task-inner'...\r\n[17:22:15] Finished 'task-inner' after 58 μs\r\n[17:22:15] Finished 'task2' after 904 μs\r\n[17:22:15] Finished 'task1' after 1.54 ms\r\n[17:22:15] Finished 'default' after 2.89 ms\r\n```\r\n\r\n\r\nWhen 'task-inner' throws an error, it prints strange long error messages.\r\nThis is just simplified case. I'm in trouble with some async plugins when it occurs some errors.\r\n[source code]\r\n```\r\nvar gulp = require('gulp');\r\nvar runSeq = require('run-sequence');\r\ngulp.task('task-inner', function () {\r\n\tthrow new Error('error');\r\n});\r\ngulp.task('task2', function (cb) {\r\n\trunSeq('task-inner', cb);\r\n});\r\ngulp.task('task1', function (cb) {\r\n\trunSeq('task2', cb);\r\n});\r\ngulp.task('default', function (cb) {\r\n\trunSeq('task1', cb);\r\n});\r\n```\r\n[output]\r\n```\r\n[17:22:26] Using gulpfile ~\\xxx\\gulpfile.js\r\n[17:22:26] Starting 'default'...\r\n[17:22:26] Starting 'task1'...\r\n[17:22:26] Starting 'task2'...\r\n[17:22:26] Starting 'task-inner'...\r\n[17:22:26] 'task-inner' errored after 75 μs\r\n[17:22:26] Error: error\r\n    at Gulp.<anonymous> (xxx\\gulpfile.js:5:8)\r\n    at module.exports (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:34:7)\r\n    at Gulp.Orchestrator._runTask (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:273:3)\r\n    at Gulp.Orchestrator._runStep (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:214:10)\r\n    at Gulp.Orchestrator.start (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:134:8)\r\n    at runNextSet (xxx\\node_modules\\run-sequence\\index.js:79:16)\r\n    at runSequence (xxx\\node_modules\\run-sequence\\index.js:90:2)\r\n    at Gulp.<anonymous> (xxx\\gulpfile.js:9:2)\r\n    at module.exports (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:34:7)\r\n    at Gulp.Orchestrator._runTask (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:273:3)\r\n[17:22:26] 'default' errored after 4.24 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n[17:22:26] 'task1' errored after 3.7 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n[17:22:26] 'task2' errored after 3.92 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n[17:22:26] 'task2' errored after 4.4 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n[17:22:26] 'task1' errored after 5.14 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n[17:22:26] 'task2' errored after 5.34 ms\r\n[17:22:26] Error: [object Object]\r\n    at formatError (xxx\\node_modules\\gulp\\bin\\gulp.js:169:10)\r\n    at Gulp.<anonymous> (xxx\\node_modules\\gulp\\bin\\gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:264:8)\r\n    at xxx\\node_modules\\gulp\\node_modules\\orchestrator\\index.js:275:23\r\n    at finish (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:21:8)\r\n    at cb (xxx\\node_modules\\gulp\\node_modules\\orchestrator\\lib\\runTask.js:29:3)\r\n    at finish (xxx\\node_modules\\run-sequence\\index.js:53:5)\r\n    at Gulp.onError (xxx\\node_modules\\run-sequence\\index.js:60:4)\r\n    at Gulp.emit (events.js:129:20)\r\n```\r\n\r\nHere is my dev environment.\r\n  * Windows 8.1 64bit\r\n  * nodejs x64 v0.12.5\r\n  * gulp 3.9.0 & run-sequence 1.1.1\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/OverZealous/run-sequence/issues/comments/118852263","html_url":"https://github.com/OverZealous/run-sequence/issues/36#issuecomment-118852263","issue_url":"https://api.github.com/repos/OverZealous/run-sequence/issues/36","id":118852263,"user":{"login":"ntopia","id":1179792,"avatar_url":"https://avatars.githubusercontent.com/u/1179792?v=3","gravatar_id":"","url":"https://api.github.com/users/ntopia","html_url":"https://github.com/ntopia","followers_url":"https://api.github.com/users/ntopia/followers","following_url":"https://api.github.com/users/ntopia/following{/other_user}","gists_url":"https://api.github.com/users/ntopia/gists{/gist_id}","starred_url":"https://api.github.com/users/ntopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntopia/subscriptions","organizations_url":"https://api.github.com/users/ntopia/orgs","repos_url":"https://api.github.com/users/ntopia/repos","events_url":"https://api.github.com/users/ntopia/events{/privacy}","received_events_url":"https://api.github.com/users/ntopia/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T13:19:38Z","updated_at":"2015-07-06T13:19:38Z","body":"Yes you're right, but the error message is too long. Don't you think?\r\n\" 'task2' errored \" is appeared 3 times. I wonder why."}}