Skip to content

Commit f84ad04

Browse files
faywonggittiver
authored andcommitted
Log the missed key when accessing rvalue through operator[]
1 parent 763933a commit f84ad04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/crow/json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
668668
if (it != end() && it->key_ == str)
669669
return *it;
670670
#ifndef CROW_JSON_NO_ERROR_CHECK
671-
throw std::runtime_error("cannot find key");
671+
throw std::runtime_error("cannot find key: " + str);
672672
#else
673673
static rvalue nullValue;
674674
return nullValue;

0 commit comments

Comments
 (0)