Skip to content

Commit b0ff280

Browse files
committed
Add msgpack prefix to type_errors
1 parent 4b0c90f commit b0ff280

27 files changed

+142
-142
lines changed

include/msgpack/adaptor/bool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
2828

2929
inline msgpack::object const& operator>> (msgpack::object const& o, bool& v)
3030
{
31-
if(o.type != msgpack::type::BOOLEAN) { throw type_error(); }
31+
if(o.type != msgpack::type::BOOLEAN) { throw msgpack::type_error(); }
3232
v = o.via.boolean;
3333
return o;
3434
}

include/msgpack/adaptor/cpp11/array.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
3131

3232
template <typename T, std::size_t N>
3333
inline msgpack::object const& operator>> (msgpack::object const& o, std::array<T, N>& v) {
34-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
35-
if(o.via.array.size != N) { throw type_error(); }
34+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
35+
if(o.via.array.size != N) { throw msgpack::type_error(); }
3636
if(o.via.array.size > 0) {
3737
msgpack::object* p = o.via.array.ptr;
3838
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;

include/msgpack/adaptor/cpp11/array_char.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ inline msgpack::object const& operator>> (msgpack::object const& o, std::array<c
3333
{
3434
switch (o.type) {
3535
case msgpack::type::BIN:
36-
if(o.via.bin.size != N) { throw type_error(); }
36+
if(o.via.bin.size != N) { throw msgpack::type_error(); }
3737
std::memcpy(v.data(), o.via.bin.ptr, o.via.bin.size);
3838
break;
3939
case msgpack::type::STR:
40-
if(o.via.str.size != N) { throw type_error(); }
40+
if(o.via.str.size != N) { throw msgpack::type_error(); }
4141
std::memcpy(v.data(), o.via.str.ptr, N);
4242
break;
4343
default:
44-
throw type_error();
44+
throw msgpack::type_error();
4545
break;
4646
}
4747
return o;

include/msgpack/adaptor/cpp11/forward_list.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
3232
template <typename T>
3333
inline msgpack::object const& operator>> (msgpack::object const& o, std::forward_list<T>& v)
3434
{
35-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
35+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
3636
v.resize(o.via.array.size);
3737
msgpack::object* p = o.via.array.ptr;
3838
for (auto &e : v) {

include/msgpack/adaptor/cpp11/tuple.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ template <typename... Args>
100100
inline msgpack::object const& operator>> (
101101
msgpack::object const& o,
102102
std::tuple<Args...>& v) {
103-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
104-
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
103+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
104+
if(o.via.array.size < sizeof...(Args)) { throw msgpack::type_error(); }
105105
StdTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
106106
return o;
107107
}

include/msgpack/adaptor/cpp11/unordered_map.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
3131
template <typename K, typename V>
3232
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_map<K, V>& v)
3333
{
34-
if(o.type != msgpack::type::MAP) { throw type_error(); }
34+
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
3535
msgpack::object_kv* p(o.via.map.ptr);
3636
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
3737
std::unordered_map<K, V> tmp;
@@ -84,7 +84,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::unordered_map<
8484
template <typename K, typename V>
8585
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multimap<K, V>& v)
8686
{
87-
if(o.type != msgpack::type::MAP) { throw type_error(); }
87+
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
8888
msgpack::object_kv* p(o.via.map.ptr);
8989
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
9090
std::unordered_multimap<K, V> tmp;

include/msgpack/adaptor/cpp11/unordered_set.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
3131
template <typename T>
3232
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_set<T>& v)
3333
{
34-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
34+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
3535
msgpack::object* p = o.via.array.ptr + o.via.array.size;
3636
msgpack::object* const pbegin = o.via.array.ptr;
3737
std::unordered_set<T> tmp;
@@ -81,7 +81,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::unordered_set<
8181
template <typename T>
8282
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multiset<T>& v)
8383
{
84-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
84+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
8585
msgpack::object* p = o.via.array.ptr + o.via.array.size;
8686
msgpack::object* const pbegin = o.via.array.ptr;
8787
std::unordered_multiset<T> tmp;

include/msgpack/adaptor/deque.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
3131
template <typename T>
3232
inline msgpack::object const& operator>> (msgpack::object const& o, std::deque<T>& v)
3333
{
34-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
34+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
3535
v.resize(o.via.array.size);
3636
msgpack::object* p = o.via.array.ptr;
3737
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;

0 commit comments

Comments
 (0)