diff --git a/structure/client/TransactionHandler.js b/structure/client/TransactionHandler.js index a556468..ca6b190 100644 --- a/structure/client/TransactionHandler.js +++ b/structure/client/TransactionHandler.js @@ -15,12 +15,16 @@ class TransactionHandler { _receive(message) { - if(!message.transactionID) return; + if(!message.transactionID) return undefined; const transaction = this.transactions.get(message.transactionID); + if(!transaction) return undefined; + if(message.error) transaction.reject(message.message); else transaction.resolve(message.result); + this.transactions.delete(message.transactionID); + } _send(message, options = {}) {