mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
fix: add a better error message for fetch when it fails with an unknown code (#9663)
* add a better error message for fetch when it fails with an unknown code * Update src/bun.js/webcore/response.zig Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * [autofix.ci] apply automated fixes * fix compilation --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -397,6 +397,14 @@ pub const String = extern struct {
|
||||
return BunString__fromUTF16(bytes.ptr, bytes.len);
|
||||
}
|
||||
|
||||
pub fn createFormat(comptime fmt: []const u8, args: anytype) !String {
|
||||
var sba = std.heap.stackFallback(16384, bun.default_allocator);
|
||||
const alloc = sba.get();
|
||||
const buf = try std.fmt.allocPrint(alloc, fmt, args);
|
||||
defer alloc.free(buf);
|
||||
return createUTF8(buf);
|
||||
}
|
||||
|
||||
pub fn createFromOSPath(os_path: bun.OSPathSlice) String {
|
||||
return switch (@TypeOf(os_path)) {
|
||||
[]const u8 => createUTF8(os_path),
|
||||
|
||||
Reference in New Issue
Block a user