I have built a contract which provides a simple method for storing some data in a property of my contract on the blockchain.
I can interface with my contract using web3.js and I have no issue doing so.
The problem is that I only want to be able to set the property if it has NOT already been set. As such the contract method checks for a zero value and returns an arbitrary error code ("0001") if it has already been set. If it has not been set "0000" is returned.
As such I can not update my interface accordingly when there is an 'error'.
I can poll the transaction hash and check for the point at which it is mined, but because even in the error case the transaction is mined, this is of little use.
web3.js loses a lot of its utility if there is no way of discerning the response of mining a transaction on the blockchain. Have I missed something?