Skip to content

Commit

Permalink
Log the missed key when accessing rvalue through operator[]
Browse files Browse the repository at this point in the history
  • Loading branch information
faywong authored and gittiver committed Oct 3, 2024
1 parent 763933a commit f84ad04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/crow/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
if (it != end() && it->key_ == str)
return *it;
#ifndef CROW_JSON_NO_ERROR_CHECK
throw std::runtime_error("cannot find key");
throw std::runtime_error("cannot find key: " + str);
#else
static rvalue nullValue;
return nullValue;
Expand Down

0 comments on commit f84ad04

Please sign in to comment.