From b6371e5794e3d8c39ca72866e5499b2121828577 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 16 Nov 2020 09:24:45 +0100 Subject: [PATCH 1/4] ref: Remove deprecated error-chain and failure crates --- Cargo.toml | 2 - sentry-backtrace/src/trim.rs | 39 ----- sentry-error-chain/Cargo.toml | 23 --- sentry-error-chain/README.md | 34 ----- sentry-error-chain/src/lib.rs | 132 ----------------- sentry-failure/Cargo.toml | 24 --- sentry-failure/README.md | 36 ----- sentry-failure/src/lib.rs | 219 ---------------------------- sentry/Cargo.toml | 9 -- sentry/examples/error-chain-demo.rs | 34 ----- sentry/examples/failure-demo.rs | 32 ---- sentry/src/defaults.rs | 28 +--- sentry/src/lib.rs | 8 - 13 files changed, 4 insertions(+), 616 deletions(-) delete mode 100644 sentry-error-chain/Cargo.toml delete mode 100644 sentry-error-chain/README.md delete mode 100644 sentry-error-chain/src/lib.rs delete mode 100644 sentry-failure/Cargo.toml delete mode 100644 sentry-failure/README.md delete mode 100644 sentry-failure/src/lib.rs delete mode 100644 sentry/examples/error-chain-demo.rs delete mode 100644 sentry/examples/failure-demo.rs diff --git a/Cargo.toml b/Cargo.toml index 0f9f9640..2fab67d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,6 @@ members = [ "sentry-contexts", "sentry-core", "sentry-debug-images", - "sentry-error-chain", - "sentry-failure", "sentry-log", "sentry-panic", "sentry-slog", diff --git a/sentry-backtrace/src/trim.rs b/sentry-backtrace/src/trim.rs index ff8fa1ad..1a2308fe 100644 --- a/sentry-backtrace/src/trim.rs +++ b/sentry-backtrace/src/trim.rs @@ -26,11 +26,6 @@ lazy_static::lazy_static! { "anyhow::", "::log", ]; - - // TODO: remove all of this together with the deprecated `error_chain` support - static ref SECONDARY_BORDER_FRAMES: Vec<(&'static str, &'static str)> = vec![ - ("error_chain::make_backtrace", ">::into") - ]; } /// A helper function to trim a stacktrace. @@ -48,42 +43,8 @@ where }); if let Some(cutoff) = known_cutoff { - let secondary = { - let func = stacktrace.frames[stacktrace.frames.len() - cutoff - 1] - .function - .as_ref() - .unwrap(); - - SECONDARY_BORDER_FRAMES - .iter() - .filter_map(|&(primary, secondary)| { - if function_starts_with(func, primary) { - Some(secondary) - } else { - None - } - }) - .next() - }; let trunc = stacktrace.frames.len() - cutoff - 1; stacktrace.frames.truncate(trunc); - - if let Some(secondary) = secondary { - let secondary_cutoff = - stacktrace - .frames - .iter() - .rev() - .position(|frame| match frame.function { - Some(ref func) => function_starts_with(&func, secondary), - None => false, - }); - - if let Some(cutoff) = secondary_cutoff { - let trunc = stacktrace.frames.len() - cutoff - 1; - stacktrace.frames.truncate(trunc); - } - } } } diff --git a/sentry-error-chain/Cargo.toml b/sentry-error-chain/Cargo.toml deleted file mode 100644 index 00f7aaa8..00000000 --- a/sentry-error-chain/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "sentry-error-chain" -version = "0.21.0" -authors = ["Sentry "] -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/getsentry/sentry-rust" -homepage = "https://sentry.io/welcome/" -description = """ -Sentry integration that allows capturing error-chain errors. -""" -edition = "2018" - -[package.metadata.docs.rs] -all-features = true - -[dependencies] -sentry-core = { version = "0.21.0", path = "../sentry-core" } -sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace" } -error-chain = "0.12.1" - -[dev-dependencies] -sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] } diff --git a/sentry-error-chain/README.md b/sentry-error-chain/README.md deleted file mode 100644 index 14460bcf..00000000 --- a/sentry-error-chain/README.md +++ /dev/null @@ -1,34 +0,0 @@ -

- - - -

- -# Sentry Rust SDK: sentry-error-chain - -Adds support for the error-chain crate. - -Errors created by the `error-chain` crate can be logged with the -`error_chain` integration. - -## Example - -```rust -use sentry_error_chain::{capture_error_chain, ErrorChainIntegration}; -let _sentry = - sentry::init(sentry::ClientOptions::default().add_integration(ErrorChainIntegration)); -let result = match function_that_might_fail() { - Ok(result) => result, - Err(err) => { - capture_error_chain(&err); - return Err(err); - } -}; -``` - -## Resources - -License: Apache-2.0 - -- [Discord](https://discord.gg/ez5KZN7) server for project discussions. -- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates diff --git a/sentry-error-chain/src/lib.rs b/sentry-error-chain/src/lib.rs deleted file mode 100644 index 6d9182b6..00000000 --- a/sentry-error-chain/src/lib.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Adds support for the error-chain crate. -//! -//! Errors created by the `error-chain` crate can be logged with the -//! `error_chain` integration. -//! -//! # Example -//! -//! ```no_run -//! # #[macro_use] extern crate error_chain; -//! # error_chain! {} -//! use sentry_error_chain::{capture_error_chain, ErrorChainIntegration}; -//! # fn function_that_might_fail() -> Result<()> { Ok(()) } -//! # fn test() -> Result<()> { -//! let _sentry = -//! sentry::init(sentry::ClientOptions::default().add_integration(ErrorChainIntegration)); -//! let result = match function_that_might_fail() { -//! Ok(result) => result, -//! Err(err) => { -//! capture_error_chain(&err); -//! return Err(err); -//! } -//! }; -//! # Ok(()) } -//! ``` - -#![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")] -#![doc(html_logo_url = "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png")] -#![warn(missing_docs)] -#![deny(unsafe_code)] -#![allow(deprecated)] - -use std::fmt::{Debug, Display}; - -use error_chain::ChainedError; -use sentry_backtrace::backtrace_to_stacktrace; -use sentry_core::parse_type_from_debug; -use sentry_core::protocol::{Event, Exception, Level}; -use sentry_core::types::Uuid; -use sentry_core::{ClientOptions, Hub, Integration}; - -fn exceptions_from_error_chain(error: &T) -> Vec -where - T: ChainedError, - T::ErrorKind: Debug + Display, -{ - let dbg = format!("{:?}", error.kind()); - let mut rv = vec![]; - rv.push(Exception { - ty: parse_type_from_debug(&dbg).to_owned(), - value: Some(error.kind().to_string()), - stacktrace: error_chain::ChainedError::backtrace(error).and_then(backtrace_to_stacktrace), - ..Default::default() - }); - - for error in error.iter().skip(1) { - let dbg = format!("{:?}", error); - rv.push(Exception { - ty: parse_type_from_debug(&dbg).to_owned(), - value: Some(error.to_string()), - ..Default::default() - }) - } - - rv -} - -/// Creates an event from an error chain. -#[deprecated = "The `error_chain` integration is deprecated and will be removed in the future."] -pub fn event_from_error_chain(e: &T) -> Event<'static> -where - T: ChainedError, - T::ErrorKind: Debug + Display, -{ - Event { - exception: exceptions_from_error_chain(e).into(), - level: Level::Error, - ..Default::default() - } -} - -/// Captures an error chain. -#[deprecated = "The `error_chain` integration is deprecated and will be removed in the future."] -pub fn capture_error_chain(e: &T) -> Uuid -where - T: ChainedError, - T::ErrorKind: Debug + Display, -{ - Hub::with_active(|hub| hub.capture_error_chain(e)) -} - -/// Hub extension methods for working with error chain -#[deprecated = "The `error_chain` integration is deprecated and will be removed in the future."] -pub trait ErrorChainHubExt { - /// Captures an error chain on a specific hub. - fn capture_error_chain(&self, e: &T) -> Uuid - where - T: ChainedError, - T::ErrorKind: Debug + Display; -} - -impl ErrorChainHubExt for Hub { - fn capture_error_chain(&self, e: &T) -> Uuid - where - T: ChainedError, - T::ErrorKind: Debug + Display, - { - self.capture_event(event_from_error_chain(e)) - } -} - -/// The Sentry `error-chain` Integration. -#[derive(Debug, Default)] -#[deprecated = "The `error_chain` integration is deprecated and will be removed in the future."] -pub struct ErrorChainIntegration; - -impl ErrorChainIntegration { - /// Creates a new `error-chain` Integration. - pub fn new() -> Self { - Self::default() - } -} - -impl Integration for ErrorChainIntegration { - fn name(&self) -> &'static str { - "error-chain" - } - - fn setup(&self, cfg: &mut ClientOptions) { - cfg.in_app_exclude.push("error_chain::"); - cfg.extra_border_frames.push("error_chain::make_backtrace"); - } -} diff --git a/sentry-failure/Cargo.toml b/sentry-failure/Cargo.toml deleted file mode 100644 index e22093de..00000000 --- a/sentry-failure/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "sentry-failure" -version = "0.21.0" -authors = ["Sentry "] -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/getsentry/sentry-rust" -homepage = "https://sentry.io/welcome/" -description = """ -Sentry integration for failure crate. -""" -edition = "2018" - -[package.metadata.docs.rs] -all-features = true - -[dependencies] -sentry-core = { version = "0.21.0", path = "../sentry-core" } -sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace" } -failure = "0.1.6" - -[dev-dependencies] -sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] } -sentry-panic = { version = "0.21.0", path = "../sentry-panic" } diff --git a/sentry-failure/README.md b/sentry-failure/README.md deleted file mode 100644 index 8a1db9dc..00000000 --- a/sentry-failure/README.md +++ /dev/null @@ -1,36 +0,0 @@ -

- - - -

- -# Sentry Rust SDK: sentry-failure - -Adds support for capturing Sentry errors from `failure` types. - -Failure errors and `Fail` objects can be logged with the failure integration. -This works really well if you use the `failure::Error` type or if you have -`failure::Fail` objects that use the failure context internally to gain a -backtrace. - -## Example - -```rust -use sentry_failure::capture_error; -let result = match function_that_might_fail() { - Ok(result) => result, - Err(err) => { - capture_error(&err); - return Err(err); - } -}; -``` - -To capture fails and not errors use `capture_fail`. - -## Resources - -License: Apache-2.0 - -- [Discord](https://discord.gg/ez5KZN7) server for project discussions. -- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates diff --git a/sentry-failure/src/lib.rs b/sentry-failure/src/lib.rs deleted file mode 100644 index 1757a6b5..00000000 --- a/sentry-failure/src/lib.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! Adds support for capturing Sentry errors from `failure` types. -//! -//! Failure errors and `Fail` objects can be logged with the failure integration. -//! This works really well if you use the `failure::Error` type or if you have -//! `failure::Fail` objects that use the failure context internally to gain a -//! backtrace. -//! -//! # Example -//! -//! ```no_run -//! # use sentry_core as sentry; -//! # fn function_that_might_fail() -> Result<(), failure::Error> { Ok(()) } -//! use sentry_failure::capture_error; -//! # fn test() -> Result<(), failure::Error> { -//! let result = match function_that_might_fail() { -//! Ok(result) => result, -//! Err(err) => { -//! capture_error(&err); -//! return Err(err); -//! } -//! }; -//! # Ok(()) } -//! ``` -//! -//! To capture fails and not errors use `capture_fail`. - -#![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")] -#![doc(html_logo_url = "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png")] -#![warn(missing_docs)] -#![deny(unsafe_code)] -#![warn(missing_doc_code_examples)] -#![allow(deprecated)] - -use std::panic::PanicInfo; - -use failure::{Error, Fail}; -use sentry_backtrace::parse_stacktrace; -use sentry_core::parse_type_from_debug; -use sentry_core::protocol::{Event, Exception, Level}; -use sentry_core::types::Uuid; -use sentry_core::{ClientOptions, Hub, Integration}; - -/// The Sentry Failure Integration. -#[derive(Debug, Default)] -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub struct FailureIntegration; - -impl FailureIntegration { - /// Creates a new Failure Integration. - pub fn new() -> Self { - Self::default() - } -} - -impl Integration for FailureIntegration { - fn name(&self) -> &'static str { - "failure" - } - - fn setup(&self, cfg: &mut ClientOptions) { - cfg.in_app_exclude.push("failure::"); - cfg.extra_border_frames.extend_from_slice(&[ - "failure::error_message::err_msg", - "failure::backtrace::Backtrace::new", - "failure::backtrace::internal::InternalBacktrace::new", - "failure::Fail::context", - ]); - } -} - -/// Extracts a Sentry `Event` from a `PanicInfo`. -/// -/// Creates a new Sentry `Event` when the panic has a `failure::Error` payload. -/// This is for use with the `sentry-panic` integration, and is enabled by -/// default in `sentry`. -/// -/// # Examples -/// -/// ``` -/// let panic_integration = -/// sentry_panic::PanicIntegration::new().add_extractor(sentry_failure::panic_extractor); -/// ``` -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn panic_extractor(info: &PanicInfo<'_>) -> Option> { - let error = info.payload().downcast_ref::()?; - Some(Event { - level: Level::Fatal, - ..event_from_error(error) - }) -} - -/// This converts a single fail instance into an exception. -/// -/// This is typically not very useful as the `event_from_error` and -/// `event_from_fail` methods will assemble an entire event with all the -/// causes of a failure, however for certain more complex situations where -/// fails are contained within a non fail error type that might also carry -/// useful information it can be useful to call this method instead. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn exception_from_single_fail( - f: &F, - bt: Option<&failure::Backtrace>, -) -> Exception { - let dbg = format!("{:?}", f); - Exception { - ty: parse_type_from_debug(&dbg).to_owned(), - value: Some(f.to_string()), - stacktrace: bt - // format the stack trace with alternate debug to get addresses - .map(|bt| format!("{:#?}", bt)) - .and_then(|x| parse_stacktrace(&x)), - ..Default::default() - } -} - -/// Helper function to create an event from a `failure::Error`. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn event_from_error(err: &failure::Error) -> Event<'static> { - let mut exceptions: Vec<_> = err - .iter_chain() - .enumerate() - .map(|(idx, cause)| { - let bt = match cause.backtrace() { - Some(bt) => Some(bt), - None if idx == 0 => Some(err.backtrace()), - None => None, - }; - exception_from_single_fail(cause, bt) - }) - .collect(); - exceptions.reverse(); - - Event { - exception: exceptions.into(), - level: Level::Error, - ..Default::default() - } -} - -/// Helper function to create an event from a `failure::Fail`. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn event_from_fail(fail: &F) -> Event<'static> { - let mut exceptions = vec![exception_from_single_fail(fail, fail.backtrace())]; - - let mut ptr: Option<&dyn Fail> = None; - while let Some(cause) = ptr.map(Fail::cause).unwrap_or_else(|| fail.cause()) { - exceptions.push(exception_from_single_fail(cause, cause.backtrace())); - ptr = Some(cause); - } - - exceptions.reverse(); - Event { - exception: exceptions.into(), - level: Level::Error, - ..Default::default() - } -} - -/// Captures a boxed failure (`failure::Error`). -/// -/// This dispatches to the current hub. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn capture_error(err: &Error) -> Uuid { - Hub::with_active(|hub| FailureHubExt::capture_error(hub.as_ref(), err)) -} - -/// Captures a `failure::Fail`. -/// -/// This dispatches to the current hub. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub fn capture_fail(fail: &F) -> Uuid { - Hub::with_active(|hub| hub.capture_fail(fail)) -} - -/// Hub extension methods for working with failure. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub trait FailureHubExt { - /// Captures a boxed failure (`failure::Error`). - fn capture_error(&self, err: &Error) -> Uuid; - /// Captures a `failure::Fail`. - fn capture_fail(&self, fail: &F) -> Uuid; -} - -impl FailureHubExt for Hub { - fn capture_error(&self, err: &Error) -> Uuid { - self.capture_event(event_from_error(err)) - } - - fn capture_fail(&self, fail: &F) -> Uuid { - self.capture_event(event_from_fail(fail)) - } -} - -/// Extension trait providing methods to unwrap a result, preserving backtraces from the -/// underlying error in the event of a panic. -#[deprecated = "The `failure` integration is deprecated and will be removed in the future."] -pub trait FailureResultExt { - /// Type of the success case - type Value; - /// Unwraps the result, panicking if it contains an error. Any backtrace attached to the - /// error will be preserved with the panic. - fn fallible_unwrap(self) -> Self::Value; -} - -impl FailureResultExt for Result -where - E: Into, -{ - type Value = T; - fn fallible_unwrap(self) -> Self::Value { - match self { - Ok(v) => v, - Err(e) => { - let e: Error = e.into(); - panic!(e) - } - } - } -} diff --git a/sentry/Cargo.toml b/sentry/Cargo.toml index b686c308..d0aebb4f 100644 --- a/sentry/Cargo.toml +++ b/sentry/Cargo.toml @@ -25,8 +25,6 @@ panic = ["sentry-panic"] # other integrations anyhow = ["sentry-anyhow"] debug-images = ["sentry-debug-images"] -error-chain = ["sentry-error-chain"] -failure = ["sentry-failure"] log = ["sentry-log"] slog = ["sentry-slog"] # other features @@ -46,8 +44,6 @@ sentry-anyhow = { version = "0.21.0", path = "../sentry-anyhow", optional = true sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace", optional = true } sentry-contexts = { version = "0.21.0", path = "../sentry-contexts", optional = true } sentry-debug-images = { version = "0.21.0", path = "../sentry-debug-images", optional = true } -sentry-error-chain = { version = "0.21.0", path = "../sentry-error-chain", optional = true } -sentry-failure = { version = "0.21.0", path = "../sentry-failure", optional = true } sentry-log = { version = "0.21.0", path = "../sentry-log", optional = true } sentry-panic = { version = "0.21.0", path = "../sentry-panic", optional = true } sentry-slog = { version = "0.21.0", path = "../sentry-slog", optional = true } @@ -61,16 +57,11 @@ serde_json = { version = "1.0.48", optional = true } [dev-dependencies] sentry-anyhow = { version = "0.21.0", path = "../sentry-anyhow" } -sentry-error-chain = { version = "0.21.0", path = "../sentry-error-chain" } -sentry-failure = { version = "0.21.0", path = "../sentry-failure" } sentry-log = { version = "0.21.0", path = "../sentry-log" } sentry-slog = { version = "0.21.0", path = "../sentry-slog" } log_ = { package = "log", version = "0.4.8", features = ["std"] } slog_ = { package = "slog", version = "2.5.2" } -failure_derive = "0.1.6" actix-web = { version = "3", default-features = false } tokio = { version = "0.2", features = ["macros"] } -failure_ = { package = "failure", version = "0.1.6" } pretty_env_logger = "0.4.0" -error-chain_ = { package = "error-chain", version = "0.12.1" } anyhow_ = { package = "anyhow", version = "1.0.30" } diff --git a/sentry/examples/error-chain-demo.rs b/sentry/examples/error-chain-demo.rs deleted file mode 100644 index db58cbb4..00000000 --- a/sentry/examples/error-chain-demo.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![allow(deprecated)] - -#[macro_use] -extern crate error_chain_; - -use sentry_error_chain::{capture_error_chain, ErrorChainIntegration}; - -error_chain! { - errors { - MyCoolError(t: &'static str) { - description("my cool error happened") - display("my cool error happened: {}", t) - } - } -} - -fn execute() -> Result<()> { - Err(ErrorKind::MyCoolError("Something went really wrong").into()) -} - -fn main() { - let _sentry = sentry::init( - sentry::ClientOptions { - release: sentry::release_name!(), - ..Default::default() - } - .add_integration(ErrorChainIntegration), - ); - - if let Err(err) = execute() { - println!("error: {}", err); - capture_error_chain(&err); - } -} diff --git a/sentry/examples/failure-demo.rs b/sentry/examples/failure-demo.rs deleted file mode 100644 index f80e3e12..00000000 --- a/sentry/examples/failure-demo.rs +++ /dev/null @@ -1,32 +0,0 @@ -#![allow(deprecated)] - -use failure::Fail; -use failure_ as failure; -use sentry_failure::capture_error; - -#[derive(Fail, Debug)] -#[fail(display = "An error occurred with error code {}. ({})", code, message)] -struct MyError { - code: i32, - message: String, -} - -fn execute() -> Result<(), failure::Error> { - Err(MyError { - code: 42, - message: "Something went really wrong".into(), - } - .into()) -} - -fn main() { - let _sentry = sentry::init(sentry::ClientOptions { - release: sentry::release_name!(), - ..Default::default() - }); - - if let Err(err) = execute() { - println!("error: {}", err); - capture_error(&err); - } -} diff --git a/sentry/src/defaults.rs b/sentry/src/defaults.rs index 70f4089f..3213fe1a 100644 --- a/sentry/src/defaults.rs +++ b/sentry/src/defaults.rs @@ -21,11 +21,9 @@ use crate::{ClientOptions, Integration}; /// /// 1. [`AttachStacktraceIntegration`] (`feature = "backtrace"`) /// 2. [`DebugImagesIntegration`] (`feature = "debug-images"`) -/// 3. [`ErrorChainIntegration`] (`feature = "error-chain"`) -/// 4. [`ContextIntegration`] (`feature = "contexts"`) -/// 5. [`FailureIntegration`] (`feature = "failure"`) -/// 6. [`PanicIntegration`] (`feature = "panic"`) -/// 7. [`ProcessStacktraceIntegration`] (`feature = "backtrace"`) +/// 3. [`ContextIntegration`] (`feature = "contexts"`) +/// 4. [`PanicIntegration`] (`feature = "panic"`) +/// 5. [`ProcessStacktraceIntegration`] (`feature = "backtrace"`) /// /// Some integrations can be used multiple times, however, the /// [`PanicIntegration`] can not, and it will not pick up custom panic @@ -46,9 +44,7 @@ use crate::{ClientOptions, Integration}; /// /// [`AttachStacktraceIntegration`]: integrations/backtrace/struct.AttachStacktraceIntegration.html /// [`DebugImagesIntegration`]: integrations/debug_images/struct.DebugImagesIntegration.html -/// [`ErrorChainIntegration`]: integrations/error_chain/struct.ErrorChainIntegration.html /// [`ContextIntegration`]: integrations/contexts/struct.ContextIntegration.html -/// [`FailureIntegration`]: integrations/failure/struct.FailureIntegration.html /// [`PanicIntegration`]: integrations/panic/struct.PanicIntegration.html /// [`ProcessStacktraceIntegration`]: integrations/backtrace/struct.ProcessStacktraceIntegration.html pub fn apply_defaults(mut opts: ClientOptions) -> ClientOptions { @@ -71,29 +67,13 @@ pub fn apply_defaults(mut opts: ClientOptions) -> ClientOptions { sentry_debug_images::DebugImagesIntegration::default(), )) } - #[cfg(feature = "error-chain")] - { - integrations.push(Arc::new( - sentry_error_chain::ErrorChainIntegration::default(), - )) - } #[cfg(feature = "contexts")] { integrations.push(Arc::new(sentry_contexts::ContextIntegration::default())); } - #[cfg(feature = "failure")] - { - integrations.push(Arc::new(sentry_failure::FailureIntegration::default())); - } #[cfg(feature = "panic")] { - #[allow(unused_mut)] - let mut integration = sentry_panic::PanicIntegration::default(); - #[cfg(feature = "failure")] - { - integration = integration.add_extractor(sentry_failure::panic_extractor); - } - integrations.push(Arc::new(integration)); + integrations.push(Arc::new(sentry_panic::PanicIntegration::default())); } #[cfg(feature = "backtrace")] { diff --git a/sentry/src/lib.rs b/sentry/src/lib.rs index e1ec08d6..d75636bc 100644 --- a/sentry/src/lib.rs +++ b/sentry/src/lib.rs @@ -107,14 +107,6 @@ pub mod integrations { #[cfg(feature = "debug-images")] #[doc(inline)] pub use sentry_debug_images as debug_images; - #[cfg(feature = "error-chain")] - #[doc(inline)] - #[deprecated = "The `error_chain` integration is deprecated and will be removed in the future."] - pub use sentry_error_chain as error_chain; - #[cfg(feature = "failure")] - #[doc(inline)] - #[deprecated = "The `failure` integration is deprecated and will be removed in the future."] - pub use sentry_failure as failure; #[cfg(feature = "log")] #[doc(inline)] pub use sentry_log as log; From bf5bce56510e1c8ff4244333c17ba851ff26f66c Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 16 Nov 2020 09:55:22 +0100 Subject: [PATCH 2/4] rm outdated makefile targets --- Makefile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 64c5d5cc..beb2fd12 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ testall: checkfast: check-no-default-features check-default-features .PHONY: checkfast -checkall: check-all-features check-no-default-features check-default-features check-failure check-panic check-all-impls check-curl-transport check-actix +checkall: check-all-features check-no-default-features check-default-features check-panic check-curl-transport check-actix .PHONY: checkall check-all-features: @@ -71,21 +71,11 @@ check-no-default-features: @cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features .PHONY: check-no-default-features -check-failure: - @echo 'NO CLIENT + FAILURE' - @cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure' -.PHONY: check-failure - check-panic: @echo 'NO CLIENT + PANIC' @cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'panic' .PHONY: check-panic -check-all-impls: - @echo 'NO CLIENT + ALL IMPLS' - @cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure,panic' -.PHONY: check-all-impls - check-curl-transport: @echo 'CURL TRANSPORT' @cd sentry && RUSTFLAGS=-Dwarnings cargo check --features curl From 210b79405db9ce28c70cdb60a00bd6024baf710e Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 16 Nov 2020 09:56:59 +0100 Subject: [PATCH 3/4] remove obsolete cache key --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0803632a..3064a073 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,6 @@ jobs: components: rustfmt, clippy - uses: Swatinem/rust-cache@v1 - with: - key: lints - name: Run cargo fmt uses: actions-rs/cargo@v1 @@ -64,8 +62,6 @@ jobs: override: true - uses: Swatinem/rust-cache@v1 - with: - key: check - run: make checkall @@ -91,8 +87,6 @@ jobs: override: true - uses: Swatinem/rust-cache@v1 - with: - key: test - name: Run cargo test uses: actions-rs/cargo@v1 @@ -125,8 +119,6 @@ jobs: override: true - uses: Swatinem/rust-cache@v1 - with: - key: fast-MSRV - run: make checkfast From 5f56647aca1f38fd0db70e199297b378b1dcfd69 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 16 Nov 2020 12:50:23 +0100 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a52dfd3..62e7de15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +**Breaking Changes**: + +- The deprecated `error-chain` and `failure` integrations, features and crates were removed. + ## 0.21.0 **Breaking Changes**: