When an account is closed (on-chain), the account.subscribe listener try to decode the account, and it throws an error. How can I handle the error, to execute a callback when the error happens. It's an expected event.
Currently, I'm getting: "Error: Invalid account discriminator". Probably because the account doesn't exist anymore.
The account.subscribe method uses Solana Web3's onAccountChange and EventEmitter.