Since this library uses only native Error, it’s hard to distinguish the reason why transaction failed. The only way at the moment is to compare error message, which is very cumbersome. I’d like to be able to do the following:
try {
// some transaction code
} catch (e) {
if (e instanceof errors.AbortedError) {
// retry
}
}
Does this make sense or is there any better way to achieve this?
This is not a good practice, because stack traces are generated at the time of instantiating the error. Therefor the error won’t have a useful stacktrace