Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions sdk/couchbase-core/src/memdx/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use serde::Deserialize;
use std::backtrace::Backtrace;
use std::error::Error as StdError;
use std::fmt::{Display, Formatter, Pointer};
use std::io;
Expand All @@ -19,15 +18,13 @@ pub struct Error {
/// A larger `Error` type was substantially slower due to all the functions
/// that pass around `Result<T, Error>`.
pub kind: Box<ErrorKind>,
pub backtrace: Backtrace,
pub source: Option<Box<dyn StdError + 'static + Send + Sync>>,
}

impl Error {
pub(crate) fn protocol_error(msg: impl Into<String>) -> Self {
Self {
kind: Box::new(ErrorKind::Protocol { msg: msg.into() }),
backtrace: Backtrace::capture(),
source: None,
}
}
Expand All @@ -38,7 +35,6 @@ impl Error {
) -> Self {
Self {
kind: Box::new(ErrorKind::Protocol { msg: msg.into() }),
backtrace: Backtrace::capture(),
source: Some(source),
}
}
Expand All @@ -49,7 +45,6 @@ impl Error {
msg: msg.into(),
arg: arg.into(),
}),
backtrace: Backtrace::capture(),
source: None,
}
}
Expand All @@ -64,7 +59,6 @@ impl Error {
msg: msg.into(),
arg: arg.into(),
}),
backtrace: Backtrace::capture(),
source: Some(source),
}
}
Expand All @@ -75,7 +69,6 @@ impl Error {
) -> Self {
Error {
kind: Box::new(ErrorKind::ConnectionFailed { msg: reason.into() }),
backtrace: Backtrace::capture(),
source: Some(source),
}
}
Expand All @@ -87,15 +80,13 @@ impl Error {
) -> Self {
Error {
kind: Box::new(ErrorKind::Dispatch { opaque, op_code }),
backtrace: Backtrace::capture(),
source: Some(source),
}
}

pub(crate) fn close_error(msg: String, source: Box<dyn StdError + Send + Sync>) -> Self {
Error {
kind: Box::new(ErrorKind::Close { msg }),
backtrace: Backtrace::capture(),
source: Some(source),
}
}
Expand Down Expand Up @@ -502,7 +493,6 @@ where
fn from(err: E) -> Self {
Self {
kind: Box::new(err.into()),
backtrace: Backtrace::capture(),
source: None,
}
}
Expand All @@ -512,7 +502,6 @@ impl From<ServerError> for Error {
fn from(value: ServerError) -> Self {
Self {
kind: Box::new(ErrorKind::Server(value)),
backtrace: Backtrace::capture(),
source: None,
}
}
Expand All @@ -524,7 +513,6 @@ impl From<io::Error> for Error {
kind: Box::new(ErrorKind::UnknownIo {
msg: value.to_string(),
}),
backtrace: Backtrace::capture(),
source: Some(Box::new(value)),
}
}
Expand Down
4 changes: 0 additions & 4 deletions sdk/couchbase-core/src/scram/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use hmac::digest::KeyInit;
use hmac::Mac;
use rand::RngCore;
use sha2::Digest;
use std::backtrace::Backtrace;
use std::error::Error;
use std::marker::PhantomData;
use std::str;
Expand Down Expand Up @@ -223,23 +222,20 @@ where
pub struct ScramError {
message: String,
source: Option<Box<dyn Error + Sync + Send>>,
backtrace: Backtrace,
}

impl ScramError {
fn new(message: impl Into<String>) -> Self {
ScramError {
message: message.into(),
source: None,
backtrace: Backtrace::capture(),
}
}

fn with_source(message: impl Into<String>, source: Box<dyn Error + Sync + Send>) -> Self {
ScramError {
message: message.into(),
source: Some(source),
backtrace: Backtrace::capture(),
}
}
}
Expand Down
1 change: 0 additions & 1 deletion sdk/couchbase-core/src/searchx/search_respreader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use bytes::Bytes;
use futures::{FutureExt, Stream, StreamExt};
use http::StatusCode;
use log::debug;
use std::backtrace::Backtrace;
use std::collections::HashMap;
use std::pin::Pin;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion sdk/couchbase-core/tests/common/test_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct EnvTestConfig {
pub username: String,
#[envconfig(from = "RCBPASSWORD", default = "password")]
pub password: String,
#[envconfig(from = "RCBCONNSTR", default = "couchbase://192.168.107.129")]
#[envconfig(from = "RCBCONNSTR", default = "couchbase://192.168.107.19")]
pub conn_string: String,
#[envconfig(from = "RCBBUCKET", default = "default")]
pub default_bucket: String,
Expand Down
Loading