solana-labs/solana-program-library

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

开放

#3,326 创建于 2022年7月7日

 (11 条评论) (3 个反应) (0 位负责人)Rust (2,401 个派生)auto 404
good first issue

仓库指标

星标
 (4,236 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南