Concordium / concordium-dapp-libraries

A coherent set of building blocks for making it as easy as possible for developers to build web-based dApps.
Apache License 2.0
7 stars 5 forks source link

Address error handling issues #44

Closed bisgardo closed 3 months ago

bisgardo commented 1 year ago

Fixed helper functions in sample dapps for extracting the message of an error - WalletConnect has a habit of throwing errors with empty message, meaning that the error is erroneously type cast to a string.

Furthermore, on errors like "user rejected the request", WalletConnect throws the reject object (which is not an Error). This has worked until now because this object just happens to have a message field, so the function would "luckily" interpret it as Error and extract this message. This changes with this fix and the object will now just render as [object Object]. Passing err as string like before will fail because we're then trying to render an object which is not allowed in React.

TODO: For the sign-message sample, we bit the dust and use any for error instead of string. We should either see if the problem can be fixed generically or do the same for the contractupdate sample.

Partially(?) resolves CBW-1148.

soerenbf commented 3 months ago

Closing this as it's outdated