mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
log error on respondWith rejection,
Former-commit-id: 8f6312a17dc9811d54e4dc31d9ada68e98bae891
This commit is contained in:
@@ -6,7 +6,20 @@ const JS = @import("../javascript.zig");
|
||||
const JSBase = @import("../base.zig");
|
||||
const Handler = struct {
|
||||
pub export fn global_signal_handler_fn(sig: i32, info: *const std.os.siginfo_t, ctx_ptr: ?*const c_void) callconv(.C) void {
|
||||
Global.panic("C++ Crash!!", .{});
|
||||
var stdout = std.io.getStdOut();
|
||||
var stderr = std.io.getStdErr();
|
||||
var source = Output.Source.init(stdout, stderr);
|
||||
Output.Source.set(&source);
|
||||
|
||||
if (Output.isEmojiEnabled()) {
|
||||
Output.prettyErrorln("<r><red>Bun will crash now<r> 😭😭😭\n", .{});
|
||||
Output.flush();
|
||||
} else {
|
||||
stderr.writeAll("Bun has crashed :'(\n") catch {};
|
||||
}
|
||||
std.mem.doNotOptimizeAway(source);
|
||||
|
||||
std.os.exit(6);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1101,7 +1101,8 @@ pub const FetchEvent = struct {
|
||||
switch (status) {
|
||||
.Fulfilled => {},
|
||||
else => {
|
||||
this.request_context.sendInternalError(error.rejectedPromise) catch {};
|
||||
VirtualMachine.vm.defaultErrorHandler(resolved.result(VirtualMachine.vm.global.vm()));
|
||||
this.request_context.sendInternalError(error.rejectedPromiseSeeConsole) catch {};
|
||||
return js.JSValueMakeUndefined(ctx);
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user