From 5c39685badae210e526cfbf572d0364c0e100a5b Mon Sep 17 00:00:00 2001 From: David Seguin Date: Sat, 2 Apr 2022 01:59:39 -0400 Subject: [PATCH] JSON formatter: show filename on empty input (#56524) * JSON formatter: show filename on empty input * [SQUASH ME] empty JSON file * [SQUASH ME] remove empty JSON file --- tools/format/format_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/format/format_main.cpp b/tools/format/format_main.cpp index 3750ee16b6bf6..e05ff55f4d57a 100644 --- a/tools/format/format_main.cpp +++ b/tools/format/format_main.cpp @@ -61,7 +61,7 @@ int main( int argc, char *argv[] ) } if( in.str().empty() ) { - std::cout << "Error, input empty." << std::endl; + std::cout << "Error, " << ( filename.empty() ? "input" : filename ) << " is empty." << std::endl; exit( EXIT_FAILURE ); } JsonOut jsout( out, true );