diff --git a/src/json.cpp b/src/json.cpp index 02a6592fa97ca..e1190994702f1 100644 --- a/src/json.cpp +++ b/src/json.cpp @@ -109,8 +109,11 @@ void JsonObject::finish() const std::string &name = p.first; if( !visited_members.count( name ) && !string_starts_with( name, "//" ) && name != "blueprint" ) { - dbg( D_ERROR ) << "Failed to visit member '" << name << "' in JsonObject at " - << jsin->line_number( start ) << ":\n" << str() << std::endl; + try { + throw_error( string_format( "Failed to visit member %s in JsonObject", name ), name ); + } catch( const JsonError &e ) { + debugmsg( "\n%s", e.what() ); + } } } }