You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using rage with agenix-rekey, an incorrect .. in a path in the Nix store meant that rage (called internally by agenix edit) could not find the specified identity file. In this case, the following error was returned:
Error: No such file or directory (os error 2)
[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report ]
By comparison, the original go implementation made the error easy to diagnose, because it reports what path it tried to load:
age: error: reading "/nix/store/identities/age/age-yubikey-identity-83905597.txt.pub": failed to open file: open /nix/store/identities/age/age-yubikey-identity-83905597.txt.pub: no such file or directory
age: report unexpected or unhelpful errors at https://filippo.io/age/report
This immediately allowed me to understand what I'd done wrong.
Suggestion
When rage tries to read a file, perhaps it should wrap the error with a context (perhaps using anyhow or eyre?) that gives the filename in question. This primarily aids in usability when rage is called by a script or inside another tool, because when used alone on the command line it is usually obvious which file cannot be found, but in situations like the above, it would be very useful.
The text was updated successfully, but these errors were encountered:
What were you trying to do
When using
rage
withagenix-rekey
, an incorrect..
in a path in the Nix store meant thatrage
(called internally byagenix edit
) could not find the specified identity file. In this case, the following error was returned:By comparison, the original go implementation made the error easy to diagnose, because it reports what path it tried to load:
This immediately allowed me to understand what I'd done wrong.
Suggestion
When
rage
tries to read a file, perhaps it should wrap the error with a context (perhaps usinganyhow
oreyre
?) that gives the filename in question. This primarily aids in usability whenrage
is called by a script or inside another tool, because when used alone on the command line it is usually obvious which file cannot be found, but in situations like the above, it would be very useful.The text was updated successfully, but these errors were encountered: