Ivan Asmer hace 4 años
padre
commit
45fcbb820c
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      index.js

+ 3 - 1
index.js

@@ -68,7 +68,9 @@ const mm = db => {
 
                     this.collection.findOne(this._id).then( data => {
                         if (!data){
-                            err(new ReferenceError('Document Not Found'))
+                            let error = new ReferenceError('Document Not Found')
+                            if (typeof err === 'function') err(error)
+                            else throw error
                         }
                         else {
                             delete this.then