added a 'message' arg to Casper.options#onDie callback
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -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 | }, | ... | ... |
-
Please register or sign in to post a comment