Commit 38c19678 38c196780bff7c4a895af90d3d3900b319a41831 by Nicolas Perriault

added a 'message' arg to Casper.options#onDie callback

1 parent 51b41755
...@@ -217,10 +217,11 @@ ...@@ -217,10 +217,11 @@
217 */ 217 */
218 die: function(message, status) { 218 die: function(message, status) {
219 this.result.status = 'error'; 219 this.result.status = 'error';
220 this.result.time = new Date().getTime() - this.startTime;
220 message = typeof(message) === "string" && message.length > 0 ? message : DEFAULT_DIE_MESSAGE; 221 message = typeof(message) === "string" && message.length > 0 ? message : DEFAULT_DIE_MESSAGE;
221 this.log(message, "error"); 222 this.log(message, "error");
222 if (typeof(this.options.onDie) === "function") { 223 if (typeof(this.options.onDie) === "function") {
223 this.options.onDie(this, status); 224 this.options.onDie(this, message, status);
224 } 225 }
225 return this.exit(Number(status) > 0 ? Number(status) : 1); 226 return this.exit(Number(status) > 0 ? Number(status) : 1);
226 }, 227 },
......