From 4de5b82c1b346a4d3f1c88f50e0e4b7bf54d50cc Mon Sep 17 00:00:00 2001 From: Fran Domovic Date: Thu, 5 Dec 2024 16:07:11 +0100 Subject: [PATCH] fix: update decode function --- .../context/config/src/client/env/config/mutate.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/context/config/src/client/env/config/mutate.rs b/crates/context/config/src/client/env/config/mutate.rs index 1b5dd383a..357ed1e15 100644 --- a/crates/context/config/src/client/env/config/mutate.rs +++ b/crates/context/config/src/client/env/config/mutate.rs @@ -146,15 +146,11 @@ impl<'a> Method for Mutate<'a> { } fn decode(response: Vec) -> eyre::Result { - if response.is_empty() { - // Empty response means success - Ok(()) - } else { - // Non-empty response means there was an error message - let error_msg = String::from_utf8(response) - .map_err(|e| eyre::eyre!("Invalid UTF-8 in the error response: {}", e))?; - eyre::bail!("Error response received from the system: '{}'", error_msg); + if !response.is_empty() { + eyre::bail!("unexpected response {:?}", response); } + + Ok(()) } }