From b5cdca0331117ad3834b61eadd94ab3fcb6d2fba Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 1 Mar 2015 21:08:49 +0100 Subject: improved error messages for empty field names. --- src/core/model/Document.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/model/Document.cpp') diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index fc39348..b29767e 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -180,7 +180,7 @@ bool DocumentEntity::doValidate(Logger &logger) const // check if the parent reference is correct. if (child->getParent() != subInst) { logger.error(std::string("A child of field \"") + - fieldDescs[f]->getName() + + fieldDescs[f]->getNameOrDefaultName() + "\" has the wrong parent reference!", *child); valid = false; @@ -209,7 +209,7 @@ bool DocumentEntity::doValidate(Logger &logger) const c->getDescriptor()->getName() + "\" is not allowed as child of an instance of \"" + descriptor->getName() + "\" in field \"" + - fieldDescs[f]->getName() + "\"", + fieldDescs[f]->getNameOrDefaultName() + "\"", *child); valid = false; continue; @@ -285,7 +285,7 @@ static int enforceGetFieldDescriptorIndex( if (idx == -1) { throw OusiaException(std::string("Descriptor \"") + desc->getName() + "\" does not reference the given field \"" + - fieldDescriptor->getName() + "\""); + fieldDescriptor->getNameOrDefaultName() + "\""); } return idx; } -- cgit v1.2.3