From fc1f14b2ebfe1b1bebdd863054a6fd9f31692f8a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 27 Aug 2020 10:13:18 +0300 Subject: [PATCH] - extended error messages in pointers serialization --- src/common/engine/serializer_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/engine/serializer_internal.h b/src/common/engine/serializer_internal.h index fb1402ab7..1be6ce74b 100644 --- a/src/common/engine/serializer_internal.h +++ b/src/common/engine/serializer_internal.h @@ -237,13 +237,13 @@ FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T ** { vv = value - base; if (vv < 0 || vv >= count) - I_Error("Trying to serialize out-of-bounds array value"); + I_Error("Trying to serialize out-of-bounds array value with key '%s', index = %lli, size = %lli", key, vv, count); } Serialize(arc, key, vv, nullptr); if (vv == -1) value = nullptr; else if (vv < 0 || vv >= count) - I_Error("Trying to serialize out-of-bounds array value"); + I_Error("Trying to serialize out-of-bounds array value with key '%s', index = %lli, size = %lli", key, vv, count); else value = base + vv; } @@ -254,7 +254,7 @@ template FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **defval, TArray &array) { if (array.Size() == 0) - I_Error("Trying to serialize a value from empty array"); + I_Error("Trying to serialize a value with key '%s' from empty array", key); return SerializePointer(arc, key, value, defval, array.Data(), array.Size()); }