From cec1b16a90acadf97b892a56fb15943a72f04398 Mon Sep 17 00:00:00 2001 From: Adam Comerford Date: Mon, 13 Jan 2014 16:05:58 -0500 Subject: SERVER-12353 Fix error message of failed $mul Checks to see the mode ($inc or $mul) of the failed update and prints out the correct one. Previously always printed $inc regardless of mode. Signed-off-by: Matt Kangas --- src/mongo/db/ops/modifier_inc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/ops/modifier_inc.cpp') diff --git a/src/mongo/db/ops/modifier_inc.cpp b/src/mongo/db/ops/modifier_inc.cpp index 7e88604e974..17c681f06a7 100644 --- a/src/mongo/db/ops/modifier_inc.cpp +++ b/src/mongo/db/ops/modifier_inc.cpp @@ -192,7 +192,9 @@ namespace mongo { mb::Element idElem = mb::findFirstChildNamed(root, "_id"); return Status( ErrorCodes::BadValue, - str::stream() << "Cannot apply $inc to a value of non-numeric type. {" + str::stream() << "Cannot apply " + << (_mode == MODE_INC ? "$inc" : "$mul") + << " to a value of non-numeric type. {" << idElem.toString() << "} has the field '" << _preparedState->elemFound.getFieldName() << "' of non-numeric type " -- cgit v1.2.1