Skip to content

Commit 130970f

Browse files
committed
RSCBC-250: Rename Disconnected error to ClusterDropped
1 parent 4ece869 commit 130970f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

sdk/couchbase/src/clients/agent_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl CouchbaseAgentProvider {
9292
pub(crate) fn upgrade_agent(agent: Weak<Agent>) -> error::Result<Arc<Agent>> {
9393
match agent.upgrade() {
9494
Some(agent) => Ok(agent),
95-
None => Err(error::Error::new(ErrorKind::Disconnected)),
95+
None => Err(error::Error::new(ErrorKind::ClusterDropped)),
9696
}
9797
}
9898
}

sdk/couchbase/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl StdError for Error {}
171171
pub enum ErrorKind {
172172
OtherFailure(String),
173173
ServerTimeout,
174-
Disconnected,
174+
ClusterDropped,
175175

176176
// Shared Error Definitions RFC#58@16
177177
InvalidArgument(InvalidArgumentErrorKind),
@@ -258,8 +258,8 @@ impl Display for ErrorKind {
258258
write!(f, "invalid argument: {msg}")
259259
};
260260
}
261-
ErrorKind::Disconnected => {
262-
"the client is disconnected (have the parent bucket or cluster been dropped?)"
261+
ErrorKind::ClusterDropped => {
262+
"the client is disconnected (the cluster resource has been dropped)"
263263
}
264264
ErrorKind::ServiceNotAvailable(service) => {
265265
return write!(f, "service not available: {service}");

sdk/couchbase/tests/connections.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn test_collection_use_after_cluster_drop() {
6060
Err(e) => e,
6161
};
6262

63-
if &ErrorKind::Disconnected == err.kind() {
63+
if &ErrorKind::ClusterDropped == err.kind() {
6464
return Ok(Some(()));
6565
}
6666

@@ -101,7 +101,7 @@ fn test_collection_level_mgr_use_after_cluster_drop() {
101101
Err(e) => e,
102102
};
103103

104-
if &ErrorKind::Disconnected == err.kind() {
104+
if &ErrorKind::ClusterDropped == err.kind() {
105105
return Ok(Some(()));
106106
}
107107

@@ -137,7 +137,7 @@ fn test_scope_use_after_cluster_drop() {
137137
Err(e) => e,
138138
};
139139

140-
if &ErrorKind::Disconnected == err.kind() {
140+
if &ErrorKind::ClusterDropped == err.kind() {
141141
return Ok(Some(()));
142142
}
143143

@@ -175,7 +175,7 @@ fn test_scope_level_mgr_use_after_cluster_drop() {
175175
Err(e) => e,
176176
};
177177

178-
if &ErrorKind::Disconnected == err.kind() {
178+
if &ErrorKind::ClusterDropped == err.kind() {
179179
return Ok(Some(()));
180180
}
181181

@@ -211,7 +211,7 @@ fn test_bucket_level_mgr_use_after_cluster_drop() {
211211
Err(e) => e,
212212
};
213213

214-
if &ErrorKind::Disconnected == err.kind() {
214+
if &ErrorKind::ClusterDropped == err.kind() {
215215
return Ok(Some(()));
216216
}
217217

@@ -246,7 +246,7 @@ fn test_cluster_level_mgr_use_after_cluster_drop() {
246246
Err(e) => e,
247247
};
248248

249-
if &ErrorKind::Disconnected == err.kind() {
249+
if &ErrorKind::ClusterDropped == err.kind() {
250250
return Ok(Some(()));
251251
}
252252

0 commit comments

Comments
 (0)