Skip to content

Commit

Permalink
Give more detailed error message on incompatible binary sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilDohne committed Mar 8, 2024
1 parent adb43f6 commit 6f57054
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PhotoshopAPI/src/Util/Endian/EndianByteSwapArr.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ constexpr bool is_little_endian = (std::endian::native == std::endian::little);
{
if (data.size() % sizeof(T) != 0)
{
PSAPI_LOG_ERROR("Endian", "Cannot decode binary data whose size is not divisible by sizeof(T)");
PSAPI_LOG_ERROR("Endian", "Cannot decode binary data whose size is not divisible by sizeof(T), got size %d and sizeof(T) = %d", data.size(), sizeof(T));
}

PROFILE_FUNCTION();
Expand Down Expand Up @@ -115,7 +115,7 @@ constexpr bool is_little_endian = (std::endian::native == std::endian::little);
{
if (data.size() % sizeof(T) != 0)
{
PSAPI_LOG_ERROR("Endian", "Cannot decode binary data whose size is not divisible by sizeof(T)");
PSAPI_LOG_ERROR("Endian", "Cannot decode binary data whose size is not divisible by sizeof(T), got size %d and sizeof(T) = %d", data.size(), sizeof(T));
}
PROFILE_FUNCTION();
std::vector<T> decodedData(data.size() / sizeof(T));
Expand Down

0 comments on commit 6f57054

Please # to comment.