╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │189 null │ │190 else │ │191 null; │ │192 - // enable_ansi is omitted here on purpose: Session.init fills it in from│ │193 - // the logged-in user's event, falling back to false when anonymous. │ │194 - const html = try renderIndexHtml(io, allocator, admin_repo_path, .{ │ │192 + │ │193 + const html = renderIndexHtml(io, allocator, admin_repo_path, .{ │ │194 .user_id = user_id, │ │195 .login_failure = login_failure, │ │196 .current_page = current_page, │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │198 - }); │ │197 + }) catch |err| switch (err) { │ │198 + error.NotFound => { │ │199 + try request.respond("not found", .{ │ │200 + .status = .not_found, │ │201 + .extra_headers = &.{.{ .name = "content-type", .value = "text/plain" }},│ │202 + }); │ │203 + return; │ │204 + }, │ │205 + else => |e| return e, │ │206 + }; │ │207 defer allocator.free(html); │ │208 + │ │209 // expire the flash cookie on the way out so a refresh doesn't keep │ │210 // showing the failure label. │ │211 var headers: [2]std.http.Header = undefined; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯