toException

Maps onto DappException. An unrecognised code becomes DappErrorCode.INTERNAL rather than throwing: a wallet is free to use codes this SDK predates, and losing the message would be worse than losing the exact code.