View this article originally posted on alphawallet.com

The banking apps had repeatedly made this mistake. Now, with more than a decade of improvements, all the banking apps have amended theirs. Sadly, it’s Ethereum Dapp’s turn to start the mistake all over again.

The mistake I’m talking about, is to mistake a user’s intention as an error.

In reality, nothing intended by the user is an error. It’s a branch of the interaction flow.

Zelda II: The Adventure of Link. Error is the name of the speaker. Together they are Link Error.

If you write a Dapp that sends a transaction, you might program something like this.

web3.eth.sendTransaction(transaction, function(error, results) {

if (error) alert(error);

});

The program detects if the user has authorised the transaction. The user will be presented with a choice like this:

The choice before sending a transaction.

If the user changed her mind and hit “reject” button here, a message pops up, saying aloud:

Error: User denied transaction signature.

I was that user. That moment the message pops up, that feeling of set-back, brought me back to a chilly morning in the early 2000s, when Beijing’s subways started to sell tickets by kiosk machines.

I was eager to try the new thing. The kiosk asked me: “This machine does not take ¥10 bills. Do you have ¥1 coins?”

I answered no. Then the machine blasted out some harsh noise, the screen went flashing, and this message popped up in bloody red:

“Error! The user does not have ¥1 coins.”

Not only such a message is unhelpful when I was already nervous about the new machine, and people were lining behind me, but it is also incorrect. An error is something that should not happen. A passenger not bringing a ¥1 coin is something that happens.

It’s the same when a user disagrees to sign a transaction that a Dapp generated. It’s not an error. The user intended the transaction not to be signed, how can an intended action be called an error?

In a virtual reality game, if a user shoots a vase with a 9mm pistol, is it an error? Of course not since the user intends the very thing to happen. If the vase doesn’t shatter under the impact of a bullet, that might be considered an error.

If a user logins in Paypal and sees a payment to her, but, as she can’t remember having any receivables, she clicks “reject”, is it an error? Of course not since the user intended the very thing to happen.

Programmers should stop thinking that any user action that made their programs less linear an “Error”. It’s convenient to mentally exclude a branch of the user’s story by calling it an error. Resist the urge.

Metamask and the web3.js team need only to do a little to help a lot, by not calling a possible flow in a user’s story an “error”, like the prototype of the demonstrated callback function. If the API doesn’t say “error”, developers will less likely mistake it for an error.

Besides, please don’t name the button “reject” (Yes Metamask I’m talking to you). Unlike in Paypal, the word “reject” is overloaded in Ethereum. When the user is presented with such a choice, she may consciously not choose “reject”, and be very confused when the transaction is later “rejected” by an Ethereum node — sometimes for a legit rejection reason, like “You can’t vote twice” in the case of a voting contract. Just putting a “No” in the dialogue box would be sufficient.