Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T05:02:22.238Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

user_error.rs

46 lines · 1.4 KB · rust
1use gpui::{AnyElement, App, Entity, FontWeight, Window};
2use ui::{Label, h_flex, prelude::*, v_flex};
3
4use crate::outputs::plain::TerminalOutput;
5
6/// Userspace error from the kernel
7#[derive(Clone)]
8pub struct ErrorView {
9    pub ename: String,
10    pub evalue: String,
11    pub traceback: Entity<TerminalOutput>,
12}
13
14impl ErrorView {
15    pub fn render(&self, window: &mut Window, cx: &mut App) -> Option<AnyElement> {
16        let theme = cx.theme();
17
18        let padding = window.line_height() / 2.;
19
20        Some(
21            v_flex()
22                .gap_3()
23                .child(
24                    h_flex()
25                        .font_buffer(cx)
26                        .child(
27                            Label::new(format!("{}: ", self.ename.clone()))
28                                .color(Color::Error)
29                                .weight(FontWeight::BOLD),
30                        )
31                        .child(Label::new(self.evalue.clone()).weight(FontWeight::BOLD)),
32                )
33                .child(
34                    div()
35                        .w_full()
36                        .px(padding)
37                        .py(padding)
38                        .border_l_1()
39                        .border_color(theme.status().error_border)
40                        .child(self.traceback.clone()),
41                )
42                .into_any_element(),
43        )
44    }
45}
46
Served at tenant.openagents/omega Member data and write actions are omitted.