Browse files

Incorrect casting of getAs and family should throw an Exception, not a

warning.  Catch if you don't like it.
  • Loading branch information...
Brendan W. McAdams
Brendan W. McAdams committed Jun 23, 2012
1 parent 529a555 commit 040831191ec6c4ff9983c43fde8f564479fdbc50
Showing with 1 addition and 1 deletion.
  1. +1 −1 casbah-commons/src/main/scala/MongoDBObject.scala
@@ -116,7 +116,7 @@ class MongoDBObject(val underlying: DBObject = new BasicDBObject) extends Map[St
case value if manifest[A] >:> Manifest.classType(value.getClass) =>
case fail =>
- log.warn("Unable to cast '%s' as '%s'; please check your types.", Manifest.classType(fail.getClass), manifest[A])
+ throw new IllegalArgumentException("Unable to cast '%s' as '%s'; please check your types.".format(Manifest.classType(fail.getClass), manifest[A]))

0 comments on commit 0408311

Please sign in to comment.