Permalink
Browse files

Error verbosity improved

  • Loading branch information...
1 parent a38bb00 commit d8ab67e9bd380b554792705d5d4e07fd06296fb8 @penartur committed May 5, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/benchmark-context.js
View
@@ -58,7 +58,10 @@ BenchmarkContext.prototype.requestPage = function (url, expectedLength, callback
callback(new Error("An error occured while trying to process " + url + ": " + error), elapsed);
} else {
if (body.length !== expectedLength) {
- callback(new Error("Expected " + expectedLength + " bytes, got " + body.length + " bytes"), elapsed);
+ callback(new Error(
+ "Response from " + url + " length is " + body.length + ";"
+ + " first response length was " + expectedLength
+ ), elapsed);
} else {
callback(false, elapsed);
}

0 comments on commit d8ab67e

Please sign in to comment.