From e26b7413c3ca4bed40200d8350fe67e34e4000e4 Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Fri, 8 May 2020 00:47:39 -0500 Subject: [PATCH] Auth failures are permanent --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 45aad04..8cd7a0b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,7 +71,12 @@ fn camera_main(camera_config: &CameraConfig, output: &mut dyn Write) -> Result<( println!("{}: Connecting to camera at {}", camera_config.name, camera_config.camera_addr); camera.connect()?; - camera.login(&camera_config.username, camera_config.password.as_deref())?; + camera.login(&camera_config.username, camera_config.password.as_deref()).map_err(|e| { + match e { + bc_protocol::Error::AuthFailed => backoff::Error::Permanent(e), + _ => backoff::Error::Transient(e) + } + })?; println!("{}: Connected to camera, starting video stream", camera_config.name); camera.start_video(output)?;