Skip to content

Commit 2261eac

Browse files
committed
expection: fix non-nullable return
1 parent 9f97725 commit 2261eac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/browser/page.zig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,10 @@ pub const Page = struct {
642642
switch (try page.scope.module(body, src)) {
643643
.value => |v| break :blk v,
644644
.exception => |e| {
645-
if (try e.exception(page.arena)) |msg| {
646-
log.info("eval module {s}: {s}", .{ src, msg });
647-
}
645+
log.info("eval module {s}: {s}", .{
646+
src,
647+
try e.exception(page.arena),
648+
});
648649
return error.JsErr;
649650
},
650651
}

src/runtime/js.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
11471147
scope: *const Scope,
11481148

11491149
// the caller needs to deinit the string returned
1150-
pub fn exception(self: Exception, allocator: Allocator) !?[]const u8 {
1150+
pub fn exception(self: Exception, allocator: Allocator) ![]const u8 {
11511151
const scope = self.scope;
11521152
return try valueToString(allocator, self.inner, scope.isolate, scope.context);
11531153
}

0 commit comments

Comments
 (0)