diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-10-27 22:20:33 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-10-27 22:35:30 -0400 |
commit | a6df5378b91516aabbb5643e41e688a0dc1aaeb7 (patch) | |
tree | 87eed969fd4ce9563d57147c1c2b772fe88ee21b | |
parent | 5d0e308c1c57bea30d2ad9008b6dbc7936d58645 (diff) | |
download | rbw-a6df5378b91516aabbb5643e41e688a0dc1aaeb7.tar.gz rbw-a6df5378b91516aabbb5643e41e688a0dc1aaeb7.zip |
add a useful error message if registration is required
-rw-r--r-- | src/api.rs | 3 | ||||
-rw-r--r-- | src/error.rs | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -1109,6 +1109,9 @@ fn classify_login_error(error_res: &ConnectErrorRes, code: u16) -> Error { }; } } + Some("Captcha required.") => { + return Error::RegistrationRequired; + } _ => {} }, "invalid_client" => { diff --git a/src/error.rs b/src/error.rs index 5eb4b4b..d584e53 100644 --- a/src/error.rs +++ b/src/error.rs @@ -135,6 +135,9 @@ pub enum Error { #[error("error waiting for pinentry to exit")] PinentryWait { source: tokio::io::Error }, + #[error("This device has not yet been registered with the Bitwarden server. Run `rbw register` first, and then try again.")] + RegistrationRequired, + #[error("failed to remove db at {}", .file.display())] RemoveDb { source: std::io::Error, |