From 28dd0180adb589cd6e19c4f9e11d333a31b0b0be Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 1 Feb 2024 17:39:54 +0900 Subject: [PATCH] cli: propagate WorkspaceLoadError::Path error transparently The inner error message is now printed by default. --- cli/src/cli_util.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 9a7761d05..731987d61 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -1901,9 +1901,6 @@ jj init --git-repo=.", "The repository directory at {} is missing. Was it moved?", repo_dir.display(), )), - // TODO: Record the error as a chained cause - WorkspaceLoadError::Path(e) => user_error(format!("{}: {}", e, e.error)), - WorkspaceLoadError::NonUnicodePath => user_error(err), WorkspaceLoadError::StoreLoadError(err @ StoreLoadError::UnsupportedType { .. }) => { internal_error_with_message( "This version of the jj binary doesn't support this type of repo", @@ -1917,6 +1914,7 @@ jj init --git-repo=.", err @ SignInitError::UnknownBackend(_), )) => user_error(err), WorkspaceLoadError::StoreLoadError(err) => internal_error(err), + WorkspaceLoadError::NonUnicodePath | WorkspaceLoadError::Path(_) => user_error(err), } }