Skip to content

Commit

Permalink
cli: propagate WorkspaceLoadError::Path error transparently
Browse files Browse the repository at this point in the history
The inner error message is now printed by default.
  • Loading branch information
yuja committed Feb 1, 2024
1 parent 9adf6e1 commit 28dd018
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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),
}
}

Expand Down

0 comments on commit 28dd018

Please sign in to comment.