node-entity
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -90,7 +90,17 @@ /** | ||
var prom; | ||
if (__.isObject(id)) { | ||
return this._mongFindOne(id); | ||
prom = this._mongFindOne(id); | ||
} else { | ||
return this._mongFindById(id); | ||
prom = this._mongFindById(id); | ||
} | ||
// intercept "Cast to ID" error types and return null instead | ||
return prom.catch(function(err) { | ||
if (err.name === 'CastError' && err.type === 'ObjectId') { | ||
return null; | ||
} | ||
throw err; | ||
}); | ||
}; | ||
@@ -97,0 +107,0 @@ |
{ | ||
"name": "node-entity", | ||
"description": "The MVCe implementation for Node.js", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"homepage": "https://github.com/thanpolas/entity", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -475,2 +475,4 @@ # Entity | ||
- **v0.2.7**, *01 Jul 2014* | ||
- Mute mongoose cast to ID errors | ||
- **v0.2.6**, *27 Jun 2014* | ||
@@ -477,0 +479,0 @@ - support more complex queries using `between` selector. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79168
1837
514