diff options
Diffstat (limited to 'Userland/Utilities/gron.cpp')
-rw-r--r-- | Userland/Utilities/gron.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Userland/Utilities/gron.cpp b/Userland/Utilities/gron.cpp index 0073da1ca1..b24eabd3eb 100644 --- a/Userland/Utilities/gron.cpp +++ b/Userland/Utilities/gron.cpp @@ -70,7 +70,15 @@ int main(int argc, char** argv) auto file_contents = file->read_all(); auto json = JsonValue::from_string(file_contents); - VERIFY(json.has_value()); + + if (!json.has_value()) { + if (path) { + warnln("Failed to parse '{}' as JSON", path); + } else { + warnln("Failed to parse stdin as JSON"); + } + return 1; + } if (use_color) { color_name = "\033[33;1m"; |