diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index f85bfe8d8f..d0952e49b8 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ - Add: servicePath field to builtin attributes (#2877) - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) +- Fix: improve error traces (#4387) diff --git a/src/lib/mongoBackend/MongoCommonUpdate.cpp b/src/lib/mongoBackend/MongoCommonUpdate.cpp index e0b3f2f1d4..e00218931b 100644 --- a/src/lib/mongoBackend/MongoCommonUpdate.cpp +++ b/src/lib/mongoBackend/MongoCommonUpdate.cpp @@ -316,7 +316,7 @@ static bool attrValueChanges(const orion::BSONObj& attr, ContextAttribute* caP, return caP->valueType != orion::ValueTypeNull; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); return false; } } @@ -442,7 +442,7 @@ static ChangeType mergeAttrInfo break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); } } diff --git a/src/lib/ngsi/ContextAttribute.cpp b/src/lib/ngsi/ContextAttribute.cpp index 9a8f939c90..f2aade9e7b 100644 --- a/src/lib/ngsi/ContextAttribute.cpp +++ b/src/lib/ngsi/ContextAttribute.cpp @@ -133,7 +133,7 @@ void ContextAttribute::bsonAppendAttrValue break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); } } @@ -217,7 +217,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); return false; } @@ -247,7 +247,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); return false; } } @@ -258,7 +258,7 @@ bool ContextAttribute::calculateOperator } else { - LM_E(("Runtime Error (uknown operator: %s)", op.c_str())); + LM_E(("Runtime Error (unknown operator: %s)", op.c_str())); return false; } diff --git a/src/lib/ngsi/ContextAttributeVector.cpp b/src/lib/ngsi/ContextAttributeVector.cpp index 234df01262..812f8c9af8 100644 --- a/src/lib/ngsi/ContextAttributeVector.cpp +++ b/src/lib/ngsi/ContextAttributeVector.cpp @@ -389,7 +389,7 @@ void ContextAttributeVector::fill break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), ca.name.c_str())); } } @@ -669,7 +669,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) @@ -705,7 +705,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) @@ -726,7 +726,7 @@ void ContextAttributeVector::applyUpdateOperators(void) } else { - LM_E(("Runtime Error (uknown operator: %s", op.c_str())); + LM_E(("Runtime Error (unknown operator: %s", op.c_str())); } } }