diff --git a/nmrs/src/api/network_manager.rs b/nmrs/src/api/network_manager.rs index e65f3e25..033789e6 100644 --- a/nmrs/src/api/network_manager.rs +++ b/nmrs/src/api/network_manager.rs @@ -366,8 +366,8 @@ impl NetworkManager { /// /// # Errors /// - /// Returns `ConnectionError::NoSavedConnection` if no VPN with the given - /// name is found. + /// Returns an error only if the operation fails unexpectedly. + /// Returns `Ok(())` if no matching VPN connection is found. pub async fn forget_vpn(&self, name: &str) -> Result<()> { crate::core::vpn::forget_vpn(&self.conn, name).await } @@ -555,8 +555,8 @@ impl NetworkManager { /// /// # Returns /// - /// Returns `Ok(())` if at least one connection was deleted successfully. - /// Returns `NoSavedConnection` if no matching connections were found. + /// Returns `Ok(())` if one or more connections were deleted successfully, + /// or if no matching connections were found. pub async fn forget(&self, ssid: &str) -> Result<()> { forget_by_name_and_type( &self.conn, diff --git a/nmrs/src/core/connection.rs b/nmrs/src/core/connection.rs index 9ca33956..7a0acf13 100644 --- a/nmrs/src/core/connection.rs +++ b/nmrs/src/core/connection.rs @@ -412,7 +412,7 @@ pub(crate) async fn forget_by_name_and_type( debug!("Bluetooth device '{name}' has no NetworkManager connection profile (device may only be paired in BlueZ)"); Ok(()) } else { - Err(ConnectionError::NoSavedConnection) + Ok(()) } } } diff --git a/nmrs/src/core/vpn.rs b/nmrs/src/core/vpn.rs index b7a57bb8..013937b7 100644 --- a/nmrs/src/core/vpn.rs +++ b/nmrs/src/core/vpn.rs @@ -571,7 +571,7 @@ pub(crate) async fn forget_vpn(conn: &Connection, name: &str) -> Result<()> { } debug!("No saved VPN connection found for '{name}'"); - Err(crate::api::models::ConnectionError::NoSavedConnection) + Ok(()) } /// Gets detailed information about a WireGuard connection.