Skip to content

Commit

Permalink
do sanity check on input iterators to ensure that the input range is …
Browse files Browse the repository at this point in the history
…not empty
  • Loading branch information
sewenew committed Oct 22, 2019
1 parent d8c0c64 commit 3ba84a8
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 234 deletions.
7 changes: 7 additions & 0 deletions src/sw/redis++/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ void throw_error(redisContext &context, const std::string &err_info);

void throw_error(const redisReply &reply);

template <typename Input>
inline void range_check(const char *cmd, Input first, Input last) {
if (first == last) {
throw Error(std::string(cmd) + ": no key specified");
}
}

}

}
Expand Down
Loading

0 comments on commit 3ba84a8

Please sign in to comment.