From 6ce676078efe0864a824f8ab8db214bef73eed7b Mon Sep 17 00:00:00 2001 From: Qrox Date: Sat, 28 Dec 2019 21:53:54 +0800 Subject: [PATCH] Improve unvisited member warning format --- src/json.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() ); + } } } }