Checking in progress, though not fully working as expected
This commit is contained in:
@@ -6,7 +6,6 @@ publish.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
crash_reporting = ["dep:sentry", "dep:sentry-log"]
|
||||
integration_tests = []
|
||||
local_fs = []
|
||||
release_bundle = []
|
||||
@@ -35,8 +34,6 @@ serde.workspace = true
|
||||
settings.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_with.workspace = true
|
||||
sentry = { workspace = true, optional = true }
|
||||
sentry-log = { workspace = true, optional = true }
|
||||
strum.workspace = true
|
||||
strum_macros.workspace = true
|
||||
sysinfo.workspace = true
|
||||
|
||||
@@ -21,8 +21,6 @@ pub struct ChannelConfig {
|
||||
pub telemetry_config: Option<TelemetryConfig>,
|
||||
/// Configuration for autoupdate functionality.
|
||||
pub autoupdate_config: Option<AutoupdateConfig>,
|
||||
/// Configuration for crash reporting.
|
||||
pub crash_reporting_config: Option<CrashReportingConfig>,
|
||||
/// Configuration for statically-bundled MCP OAuth credentials.
|
||||
pub mcp_static_config: Option<McpStaticConfig>,
|
||||
}
|
||||
@@ -130,12 +128,6 @@ pub struct AutoupdateConfig {
|
||||
pub show_autoupdate_menu_items: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct CrashReportingConfig {
|
||||
/// The URL/DSN for sending error logs and crash reports to Sentry.
|
||||
pub sentry_url: Cow<'static, str>,
|
||||
}
|
||||
|
||||
/// Configuration for statically-bundled MCP OAuth credentials.
|
||||
///
|
||||
/// These are credentials for OAuth providers where dynamic client registration
|
||||
|
||||
@@ -48,7 +48,6 @@ impl ChannelState {
|
||||
oz_config: OzConfig::production(),
|
||||
telemetry_config: None,
|
||||
autoupdate_config: None,
|
||||
crash_reporting_config: None,
|
||||
mcp_static_config: None,
|
||||
},
|
||||
}
|
||||
@@ -196,13 +195,6 @@ impl ChannelState {
|
||||
CHANNEL_STATE.lock().config.telemetry_config.is_some()
|
||||
}
|
||||
|
||||
/// Returns whether this build has a crash reporting config and can therefore
|
||||
/// ship crash reports. Builds like OpenWarp intentionally ship with
|
||||
/// `crash_reporting_config: None`, in which case UI that controls crash
|
||||
/// reporting should be hidden since the toggle has no effect.
|
||||
pub fn is_crash_reporting_available() -> bool {
|
||||
CHANNEL_STATE.lock().config.crash_reporting_config.is_some()
|
||||
}
|
||||
|
||||
pub fn releases_base_url() -> Cow<'static, str> {
|
||||
CHANNEL_STATE
|
||||
@@ -346,16 +338,6 @@ impl ChannelState {
|
||||
option_env!("GIT_RELEASE_TAG")
|
||||
}
|
||||
|
||||
pub fn sentry_url() -> Cow<'static, str> {
|
||||
CHANNEL_STATE
|
||||
.lock()
|
||||
.config
|
||||
.crash_reporting_config
|
||||
.as_ref()
|
||||
.map(|crc| crc.sentry_url.clone())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn show_autoupdate_menu_items() -> bool {
|
||||
CHANNEL_STATE
|
||||
.lock()
|
||||
|
||||
@@ -103,25 +103,12 @@ macro_rules! report_if_error {
|
||||
}
|
||||
pub use report_if_error;
|
||||
|
||||
/// Returns whether or not a log entry with the given metadata should be
|
||||
/// ignored by Sentry.
|
||||
#[cfg(feature = "crash_reporting")]
|
||||
pub fn should_ignore_log_for_sentry(md: &log::Metadata) -> bool {
|
||||
// Filter out any Error-level log entries generated by report_error!().
|
||||
// report_error!() utilizes capture_anyhow() to report structured errors
|
||||
// instead of simple string error messages, and we don't want to _also_
|
||||
// report the Error-level log line to Sentry.
|
||||
md.target() == LOG_TARGET && md.level() == log::Level::Error
|
||||
}
|
||||
|
||||
pub trait ErrorExt: RegisteredError + std::error::Error {
|
||||
/// Returns whether or not an error is something that is actionable by our
|
||||
/// engineering team.
|
||||
fn is_actionable(&self) -> bool;
|
||||
|
||||
fn report_error(&self) {
|
||||
#[cfg(feature = "crash_reporting")]
|
||||
sentry::capture_error(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,5 @@ impl AnyhowErrorExt for anyhow::Error {
|
||||
}
|
||||
|
||||
fn report_error(&self) {
|
||||
#[cfg(feature = "crash_reporting")]
|
||||
sentry::integrations::anyhow::capture_anyhow(self);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user