Skip to content

Commit 13f5a22

Browse files
committed
fix error printing
1 parent 16887e9 commit 13f5a22

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/cli/check.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn checkHtml(
148148
) !void {
149149
const ast = try super.html.Ast.init(arena, code, .html);
150150
if (ast.errors.len > 0) {
151-
ast.printErrors(code, path);
151+
try ast.printErrors(code, path, std.io.getStdErr().writer());
152152
std.process.exit(1);
153153
}
154154
}
@@ -160,13 +160,13 @@ fn checkSuper(
160160
) !void {
161161
const html = try super.html.Ast.init(arena, code, .superhtml);
162162
if (html.errors.len > 0) {
163-
html.printErrors(code, path);
163+
try html.printErrors(code, path, std.io.getStdErr().writer());
164164
std.process.exit(1);
165165
}
166166

167167
const s = try super.Ast.init(arena, html, code);
168168
if (s.errors.len > 0) {
169-
s.printErrors(code, path);
169+
try s.printErrors(code, path, std.io.getStdErr().writer());
170170
std.process.exit(1);
171171
}
172172
}

src/cli/fmt.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ pub fn fmtHtml(
170170
) ![]const u8 {
171171
const ast = try super.html.Ast.init(arena, code, .html);
172172
if (ast.errors.len > 0) {
173-
ast.printErrors(code, path);
173+
try ast.printErrors(code, path, std.io.getStdErr().writer());
174174
std.process.exit(1);
175175
}
176176

@@ -184,7 +184,7 @@ fn fmtSuper(
184184
) ![]const u8 {
185185
const ast = try super.html.Ast.init(arena, code, .superhtml);
186186
if (ast.errors.len > 0) {
187-
ast.printErrors(code, path);
187+
try ast.printErrors(code, path, std.io.getStdErr().writer());
188188
std.process.exit(1);
189189
}
190190

src/cli/interface.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ fn renderInterface(
7575
) ![]const u8 {
7676
const html_ast = try super.html.Ast.init(arena, code, .superhtml);
7777
if (html_ast.errors.len > 0) {
78-
html_ast.printErrors(code, path);
78+
try html_ast.printErrors(code, path, std.io.getStdErr().writer());
7979
std.process.exit(1);
8080
}
8181

8282
const s = try super.Ast.init(arena, html_ast, code);
8383
if (s.errors.len > 0) {
84-
s.printErrors(code, path);
84+
try s.printErrors(code, path, std.io.getStdErr().writer());
8585
std.process.exit(1);
8686
}
8787

0 commit comments

Comments
 (0)