mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
expection: fix non-nullable return
This commit is contained in:
@@ -642,9 +642,10 @@ pub const Page = struct {
|
|||||||
switch (try page.scope.module(body, src)) {
|
switch (try page.scope.module(body, src)) {
|
||||||
.value => |v| break :blk v,
|
.value => |v| break :blk v,
|
||||||
.exception => |e| {
|
.exception => |e| {
|
||||||
if (try e.exception(page.arena)) |msg| {
|
log.info("eval module {s}: {s}", .{
|
||||||
log.info("eval module {s}: {s}", .{ src, msg });
|
src,
|
||||||
}
|
try e.exception(page.arena),
|
||||||
|
});
|
||||||
return error.JsErr;
|
return error.JsErr;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1147,7 +1147,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
scope: *const Scope,
|
scope: *const Scope,
|
||||||
|
|
||||||
// the caller needs to deinit the string returned
|
// the caller needs to deinit the string returned
|
||||||
pub fn exception(self: Exception, allocator: Allocator) !?[]const u8 {
|
pub fn exception(self: Exception, allocator: Allocator) ![]const u8 {
|
||||||
const scope = self.scope;
|
const scope = self.scope;
|
||||||
return try valueToString(allocator, self.inner, scope.isolate, scope.context);
|
return try valueToString(allocator, self.inner, scope.isolate, scope.context);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user