Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set the return value to 'undefined' on an unexpected error (since we …

…always use a callback); improve comments
  • Loading branch information...
commit eb6642140ce7c565bbc7e6182373e752688e149c 1 parent d6604c3
@adamstallard adamstallard authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/vows/suite.js
View
4 lib/vows/suite.js
@@ -129,12 +129,14 @@ this.Suite.prototype = new(function () {
}
// Run the topic, passing the previous context topics
- // If topic `throw`s an exception, pass it down as a value
try {
topic = topic.apply(ctx.env, ctx.topics);
}
+ // If an unexpected error occurs in the topic, set the return
+ // value to 'undefined' and call back with the error
catch (ex) {
ctx.env.callback(ex);
+ topic = undefined;
}
if (typeof(topic) === 'undefined') { ctx._callback = true }
Please sign in to comment.
Something went wrong with that request. Please try again.