Skip to content

Improve error message when interpolating a missing path value #7303

@roberth

Description

@roberth

Is your feature request related to a problem? Please describe.

Users may not be aware of the meaning of interpolating a path value (adding it to the store).
Alternatively, the may not realize that their subexpression evaluates to a path value, making the following error surprising:

nix-repl> "${/var/lib/someService}"
error: getting status of '/var/lib/someService': No such file or directory

Nix could provide more context in this situation.

  • while adding a path to the store
  • while interpolating a path value into a string, at location xyz

Describe the solution you'd like

nix-repl> "${/var/lib/someService}"
error: getting status of '/var/lib/someService': No such file or directory
          while adding a path to the store
          while interpolating a path value into a string, at <command line>:1:3

or similar

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXThe way in which users interact with Nix. Higher level than UI.error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposalstale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions