solana-labs/solana-program-library
[spl-token]: getOrCreateAssociatedTokenAccount throws TokenAccountNotFoundError for different errors
Aperta
#3326 aperta il 7 lug 2022
good first issue
Metriche repository
- Star
- (4236 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
I noticed that when calling getOrCreateAssociatedTokenAccount, TokenAccountNotFoundError gets thrown in very different situations. I'm wondering if this can be improved to throw more specific errors?
2 specific scenarios that I found is when the payer account doesn't have enough SOL, it throws this error
And also when the method takes too long, it also throws this method even though the account is created after the fact.