coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.59k stars 1.32k forks source link

feature suggestion: 'Unable to read keypair file' should include name of keypair file it cannot read #2884

Closed mikemaccana closed 5 months ago

mikemaccana commented 6 months ago

Very minor but based on experience in class where people hadn't previously set up the Solana tools:

Error: Unable to read keypair file

is difficult for people that aren't aware of what they default keypair file used by the Solana CLI is (or that Anchor uses the same keypair file as the Solana CLI). It would be preferable if the error looked similar to:

Error: Unable to read keypair file (/home/user/.config/solana/id.json)

specifying whatever the file name in question is.

acheroncrypto commented 6 months ago

Yeah, it's annoying that the default file not found error in Rust doesn't output the path.

We might also be able to generate a keypair if it doesn't exist, which would remove the necessity of creating the keypair to get started with Anchor development.