Skip to content

Commit d726b79

Browse files
committed
Improve jsonpointer remove err msg
1 parent 6634f17 commit d726b79

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/jsoncons_ext/jsonpointer/jsonpointer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ namespace jsonpointer {
951951
{
952952
if (location.empty())
953953
{
954-
ec = jsonpointer_errc::expected_location;
954+
ec = jsonpointer_errc::cannot_remove_root;
955955
return;
956956
}
957957

include/jsoncons_ext/jsonpointer/jsonpointer_error.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum class jsonpointer_errc
5656
argument_to_unflatten_invalid,
5757
invalid_flattened_key,
5858
invalid_uri_escaped_data,
59-
expected_location
59+
cannot_remove_root
6060
};
6161

6262
class jsonpointer_error_category_impl
@@ -93,8 +93,8 @@ class jsonpointer_error_category_impl
9393
return "Argument to unflatten must be an object";
9494
case jsonpointer_errc::invalid_flattened_key:
9595
return "Flattened key is invalid";
96-
case jsonpointer_errc::expected_location:
97-
return "Expected location";
96+
case jsonpointer_errc::cannot_remove_root:
97+
return "Cannot remove root of target document";
9898
default:
9999
return "Unknown jsonpointer error";
100100
}

0 commit comments

Comments
 (0)