feat: add error log panel (#25)

Reviewed-on: #25
Co-authored-by: Ren Amamiya <reya@lume.nu>
Co-committed-by: Ren Amamiya <reya@lume.nu>
This commit was merged in pull request #25.
This commit is contained in:
Ren Amamiya
2026-03-30 07:56:28 +00:00
committed by reya
parent d36364d60d
commit 8205c69e19
7 changed files with 438 additions and 191 deletions

View File

@@ -2,6 +2,7 @@ use std::hash::Hash;
use std::ops::Range;
use common::{EventUtils, NostrParser};
use gpui::SharedString;
use nostr_sdk::prelude::*;
/// New message.
@@ -24,6 +25,25 @@ impl NewMessage {
}
}
/// Trash message.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct FailedMessage {
pub raw_event: SharedString,
pub reason: SharedString,
}
impl FailedMessage {
pub fn new<T>(event: &Event, reason: T) -> Self
where
T: Into<SharedString>,
{
Self {
raw_event: SharedString::from(event.as_json()),
reason: reason.into(),
}
}
}
/// Message.
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub enum Message {