Permalink
Browse files

normalize errors

  • Loading branch information...
Raynos committed Feb 14, 2013
1 parent 2e70eec commit a53ddd3c48739efeb8b402c7489e75da22ca747e
Showing with 4 additions and 0 deletions.
  1. +4 −0 cursor.js
View
@@ -11,6 +11,10 @@ reduce.define(Cursor, function (cursor, next, initial) {
function recurse() {
cursor.nextObject(function (error, value) {
if (error) {
+ if (typeof error === "string") {
+ error = new Error(error)
+ }
+
return next(error, result)
}

0 comments on commit a53ddd3

Please sign in to comment.