IMO, it would be ideal if we could allow users to do the following:
try {
// some awesome SDK functions/methods used.
} catch (e) {
switch (sdk.asErdstallError(e)) {
case "Connection": // Handle connection error.
case "Signature": // Handle signature error.
}
// Standard way to handle errors.
}
I realise this is opinionated, but I really dislike the way errors have to be checked in "default" TS. Finding a trusted and battletested library which could be used to take some burden off of the user and guiding them to properly handle exceptions/errors is beneficial in the long run.
As mentioned in https://github.com/perun-network/erdstall-ts-sdk/pull/69#discussion_r701865821, we are not really sure how to properly expose errors thrown by our SDK.
IMO, it would be ideal if we could allow users to do the following:
I realise this is opinionated, but I really dislike the way errors have to be checked in "default" TS. Finding a trusted and battletested library which could be used to take some burden off of the user and guiding them to properly handle exceptions/errors is beneficial in the long run.