diff options
| author | gingerBill <bill@gingerbill.org> | 2024-04-08 13:36:23 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-04-08 13:36:23 +0100 |
| commit | 16dc79fc5c98228471ed57eb0f8e853de739f6d9 (patch) | |
| tree | 82db1c730235763717e21735f82f0ad420cfe197 | |
| parent | 2aca370a0aac3ed93c60fee1484dd0187f3e47a9 (diff) | |
Add `"type"` field to `-json-errors`
| -rw-r--r-- | src/error.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/error.cpp b/src/error.cpp index c92392dce..eb167d4c3 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -667,6 +667,14 @@ gb_internal void print_all_errors(void) { gb_fprintf(f, "\t\t{\n"); + gb_fprintf(f, "\t\t\t\"type\": \""); + if (ev.kind == ErrorValue_Warning) { + gb_fprintf(f, "warning"); + } else { + gb_fprintf(f, "error"); + } + gb_fprintf(f, "\",\n"); + gb_fprintf(f, "\t\t\t\"pos\": {\n"); if (ev.pos.file_id) { |