Skip to content

Commit 776f9c1

Browse files
authored
Merge pull request #33 from GrigoriySokolov/widen_exception_buf
Widen name buffer in messages of exceptions
2 parents 97807bc + 1960995 commit 776f9c1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

med/exception.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class exception : public std::exception
4949
struct overflow : exception
5050
{
5151
overflow(char const* name, std::size_t bytes, char const* bufpos = nullptr) noexcept
52-
{ format(bufpos, "'%.32s' needs %zu octets.", name, bytes); }
52+
{ format(bufpos, "'%.64s' needs %zu octets.", name, bytes); }
5353

5454
template <class CTX>
5555
overflow(char const* name, std::size_t bytes, CTX const& ctx) noexcept
@@ -61,7 +61,7 @@ struct value_exception : public exception {};
6161
struct invalid_value : public value_exception
6262
{
6363
invalid_value(char const* name, std::size_t val, char const* bufpos = nullptr) noexcept
64-
{ format(bufpos, "Invalid value of '%.32s' = 0x%zX.", name, val); }
64+
{ format(bufpos, "Invalid value of '%.64s' = 0x%zX.", name, val); }
6565

6666
template <class CTX>
6767
invalid_value(char const* name, std::size_t val, CTX const& ctx) noexcept
@@ -70,7 +70,7 @@ struct invalid_value : public value_exception
7070
struct unknown_tag : public value_exception
7171
{
7272
unknown_tag(char const* name, std::size_t val, char const* bufpos = nullptr) noexcept
73-
{ format(bufpos, "Unknown tag of '%.32s' = 0x%zX.", name, val); }
73+
{ format(bufpos, "Unknown tag of '%.64s' = 0x%zX.", name, val); }
7474

7575
template <class CTX>
7676
unknown_tag(char const* name, std::size_t val, CTX const& ctx) noexcept
@@ -82,7 +82,7 @@ struct ie_exception : public exception {};
8282
struct missing_ie : public ie_exception
8383
{
8484
missing_ie(char const* name, std::size_t exp, std::size_t got, char const* bufpos = nullptr) noexcept
85-
{ format(bufpos, "Missing IE '%.32s': at least %zu expected, got %zu.", name, exp, got); }
85+
{ format(bufpos, "Missing IE '%.64s': at least %zu expected, got %zu.", name, exp, got); }
8686

8787
template <class CTX>
8888
missing_ie(char const* name, std::size_t exp, std::size_t got, CTX const& ctx) noexcept
@@ -91,7 +91,7 @@ struct missing_ie : public ie_exception
9191
struct extra_ie : public ie_exception
9292
{
9393
extra_ie(char const* name, std::size_t exp, std::size_t got, char const* bufpos = nullptr) noexcept
94-
{ format(bufpos, "Excessive IE '%.32s': no more than %zu expected, got %zu.", name, exp, got); }
94+
{ format(bufpos, "Excessive IE '%.64s': no more than %zu expected, got %zu.", name, exp, got); }
9595

9696
template <class CTX>
9797
extra_ie(char const* name, std::size_t exp, std::size_t got, CTX const& ctx) noexcept
@@ -102,7 +102,7 @@ struct extra_ie : public ie_exception
102102
struct out_of_memory : public exception
103103
{
104104
out_of_memory(char const* name, std::size_t bytes, char const* bufpos = nullptr) noexcept
105-
{ format(bufpos, "No space to allocate '%.32s': %zu octets.", name, bytes); }
105+
{ format(bufpos, "No space to allocate '%.64s': %zu octets.", name, bytes); }
106106

107107
template <class CTX>
108108
out_of_memory(char const* name, std::size_t bytes, CTX const& ctx) noexcept

0 commit comments

Comments
 (0)