diff options
Diffstat (limited to 'crates/turtle')
| -rw-r--r-- | crates/turtle/src/atuin_client/record/sync.rs | 2 | ||||
| -rw-r--r-- | crates/turtle/src/atuin_client/settings.rs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/crates/turtle/src/atuin_client/record/sync.rs b/crates/turtle/src/atuin_client/record/sync.rs index 3057bb10..b12d96c1 100644 --- a/crates/turtle/src/atuin_client/record/sync.rs +++ b/crates/turtle/src/atuin_client/record/sync.rs @@ -23,7 +23,7 @@ pub(crate) enum SyncError { #[error("operational error: {msg:?}")] OperationalError { msg: String }, - #[error("a request to the sync server failed: {msg:?}")] + #[error("a request to the sync server failed: {msg}")] RemoteRequestError { msg: String }, #[error( diff --git a/crates/turtle/src/atuin_client/settings.rs b/crates/turtle/src/atuin_client/settings.rs index 98829529..9e14c4c8 100644 --- a/crates/turtle/src/atuin_client/settings.rs +++ b/crates/turtle/src/atuin_client/settings.rs @@ -834,12 +834,17 @@ impl Sync { pub(crate) fn user_id(&self) -> Result<Option<Uuid>> { Self::try_read_file(self.user_id_path.as_ref())? - .map(|file| Uuid::try_parse(&file).map_err(Into::into)) + .map(|file| { + Uuid::parse_str(file.trim()).context( + "Failed to decode user id as UUID, while trying to decode sync user_id", + ) + }) .transpose() } pub(crate) fn encryption_key(&self) -> Result<Option<Key>> { Self::try_read_file(self.encryption_key_path.as_ref())? .as_deref() + .map(str::trim) .map(decode_key) .transpose() } |
