Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Jul 5, 2024
1 parent 0d1ed88 commit 51a9950
Show file tree
Hide file tree
Showing 5 changed files with 304 additions and 104 deletions.
10 changes: 0 additions & 10 deletions relay-event-schema/src/protocol/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,16 +816,6 @@ impl Getter for Event {
}
}

impl Getter for Exception {
fn get_value(&self, path: &str) -> Option<Val<'_>> {
Some(match path {
"ty" => self.ty.as_str()?.into(),
"value" => self.value.as_str()?.into(),
_ => return None,
})
}
}

#[cfg(test)]
mod tests {
use chrono::{TimeZone, Utc};
Expand Down
12 changes: 11 additions & 1 deletion relay-event-schema/src/protocol/exception.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(feature = "jsonschema")]
use relay_jsonschema_derive::JsonSchema;
use relay_protocol::{Annotated, Empty, FromValue, IntoValue, Object, Value};
use relay_protocol::{Annotated, Empty, FromValue, Getter, IntoValue, Object, Val, Value};

use crate::processor::ProcessValue;
use crate::protocol::{JsonLenientString, Mechanism, RawStacktrace, Stacktrace, ThreadId};
Expand Down Expand Up @@ -72,6 +72,16 @@ pub struct Exception {
pub other: Object<Value>,
}

impl Getter for Exception {
fn get_value(&self, path: &str) -> Option<Val<'_>> {
Some(match path {
"ty" => self.ty.as_str()?.into(),
"value" => self.value.as_str()?.into(),
_ => return None,
})
}
}

#[cfg(test)]
mod tests {
use relay_protocol::Map;
Expand Down
Loading

0 comments on commit 51a9950

Please sign in to comment.