improved error messages for binary formats #1288

This commit is the equivalent of #1282 for CBOR, MessagePack, and UBJSON.
This commit is contained in:
Niels Lohmann 2018-10-17 12:15:58 +02:00
parent dd672939a0
commit dbb0b63187
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
7 changed files with 364 additions and 282 deletions

View file

@ -767,7 +767,7 @@ class binary_writer
}
else
{
JSON_THROW(out_of_range::create(407, "number overflow serializing " + std::to_string(n)));
JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(n) + " cannot be represented by UBJSON as it does not fit int64"));
}
}
@ -821,7 +821,7 @@ class binary_writer
// LCOV_EXCL_START
else
{
JSON_THROW(out_of_range::create(407, "number overflow serializing " + std::to_string(n)));
JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(n) + " cannot be represented by UBJSON as it does not fit int64"));
}
// LCOV_EXCL_STOP
}