diff options
Diffstat (limited to 'src/common/DataStores/DB2FileLoader.cpp')
-rw-r--r-- | src/common/DataStores/DB2FileLoader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp index 57ec7df6e3f..7a586178794 100644 --- a/src/common/DataStores/DB2FileLoader.cpp +++ b/src/common/DataStores/DB2FileLoader.cpp @@ -2076,19 +2076,23 @@ void DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo) if (loadInfo) { uint32 fieldIndex = 0; + std::string signValidationResult; if (!loadInfo->Meta->HasIndexFieldInData()) { - ASSERT(!loadInfo->Fields[0].IsSigned, "ID must be unsigned in %s", source->GetFileName()); + if (loadInfo->Fields[0].IsSigned) + signValidationResult += Trinity::StringFormat("ID must be unsigned in {}", source->GetFileName()); ++fieldIndex; } for (uint32 f = 0; f < loadInfo->Meta->FieldCount; ++f) { - ASSERT(loadInfo->Fields[fieldIndex].IsSigned == _impl->IsSignedField(f), - "Field %s in %s must be %s%s", loadInfo->Fields[fieldIndex].Name, source->GetFileName(), _impl->IsSignedField(f) ? "signed" : "unsigned", - _impl->GetExpectedSignMismatchReason(f)); + if (loadInfo->Fields[fieldIndex].IsSigned != _impl->IsSignedField(f)) + signValidationResult += Trinity::StringFormat("Field {} in {} must be {}{}", loadInfo->Fields[fieldIndex].Name, + source->GetFileName(), _impl->IsSignedField(f) ? "signed" : "unsigned", _impl->GetExpectedSignMismatchReason(f)); fieldIndex += loadInfo->Meta->Fields[f].ArraySize; } + if (!signValidationResult.empty()) + throw DB2FileLoadException(std::move(signValidationResult)); } } |