pub struct Report {
pub class: String,
pub message: String,
pub handled: bool,
pub severity: Severity,
pub context: Map<String, Value>,
pub source: String,
pub timestamp: i64,
pub environment: Environment,
/* private fields */
}Expand description
One reported error, as subscribers receive it.
§Examples
use ocre::errors::{Options, Reporter};
let reporter = Reporter::default();
reporter.report(&"quota exceeded", Options::new().context("plan", "free"));
let report = &reporter.take()[0];
assert_eq!((report.message.as_str(), report.class.as_str()), ("quota exceeded", "&str"));
assert_eq!(report.context["plan"], "free");Fields§
§class: StringThe error’s type, e.g. ocre::error::Error (Sentry’s exception type).
message: StringThe error’s text (Display).
handled: boolWhether the app recovered from it.
severity: SeverityHow bad it is.
context: Map<String, Value>The request’s context, then the report’s own entries.
source: StringWhere it comes from: application, ocre.request, ocre.job…
timestamp: i64When it was reported, in Unix seconds.
environment: EnvironmentDevelopment or production, from the build profile.
Trait Implementations§
impl StructuralPartialEq for Report
Auto Trait Implementations§
impl Freeze for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnsafeUnpin for Report
impl UnwindSafe for Report
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more