solana-labs/solana-program-library

[spl-token]: getOrCreateAssociatedTokenAccount throws TokenAccountNotFoundError for different errors

Ouverte

#3 326 ouverte le 7 juil. 2022

 (11 commentaires) (3 réactions) (0 personne assignée)Rust (2 401 forks)auto 404
good first issue

Métriques du dépôt

Stars
 (4 236 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur