Skip to content

Commit

Permalink
- extended error messages in pointers serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Aug 27, 2020
1 parent dad0a6f commit fc1f14b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/engine/serializer_internal.h
Expand Up @@ -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;
}
Expand All @@ -254,7 +254,7 @@ template<class T>
FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **defval, TArray<T> &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());
}

0 comments on commit fc1f14b

Please sign in to comment.