mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat: add unique constraint restriction for KV (#3723)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -165,10 +165,12 @@ impl RedisErrorExt for error_stack::Report<RedisError> {
|
||||
RedisError::NotFound => self.change_context(DataStorageError::ValueNotFound(format!(
|
||||
"Data does not exist for key {key}",
|
||||
))),
|
||||
RedisError::SetNxFailed => self.change_context(DataStorageError::DuplicateValue {
|
||||
entity: "redis",
|
||||
key: Some(key.to_string()),
|
||||
}),
|
||||
RedisError::SetNxFailed | RedisError::SetAddMembersFailed => {
|
||||
self.change_context(DataStorageError::DuplicateValue {
|
||||
entity: "redis",
|
||||
key: Some(key.to_string()),
|
||||
})
|
||||
}
|
||||
_ => self.change_context(DataStorageError::KVError),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user