Skip to content

Commit 0d70f97

Browse files
author
Maciej Wójcik
committed
handle command errors
1 parent 49d1a1d commit 0d70f97

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/wgapi_windows.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
219219
WireguardInterfaceError::ServiceInstallationFailed { err, message }
220220
})?;
221221

222+
debug!("Done disabling automatic restart for the new service. Service update output: {service_update_output:?}",);
223+
if !service_update_output.status.success() {
224+
let message = format!(
225+
"Failed to configure WireGuard tunnel service: {:?}",
226+
service_update_output.stdout
227+
);
228+
return Err(WireguardInterfaceError::ServiceInstallationFailed {
229+
err: io::Error::new(io::ErrorKind::Other, "Cannot configure service"),
230+
message,
231+
});
232+
}
233+
222234
// TODO: set maximum transfer unit (MTU)
223235

224236
info!(

0 commit comments

Comments
 (0)