Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix flake: clarify error message when file is an unknown type #12167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RossComputerGuy
Copy link
Member

Motivation

Clarify the error as seen in #11217

Context

#11217 is where this behavior has been seen

Simply clarifying the error makes the user know why the failure occurred.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

src/nix/flake.cc Outdated
@@ -941,7 +941,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
createSymlink(target, os_string_to_string(PathViewNG { to2 }));
}
else
throw Error("file '%s' has unsupported type", from2);
throw Error("path '%s' is not either a symlink, file, or directory but a %s", from2, st.typeString());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw Error("path '%s' is not either a symlink, file, or directory but a %s", from2, st.typeString());
throw Error("path '%s' needs to be a symlink, file, or directory but instead is a %s", from2, st.typeString());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@RossComputerGuy RossComputerGuy force-pushed the fix/unsupported-type-docker branch from ad7111c to bbf2efc Compare January 10, 2025 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-cli Relating to the "nix" command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants