At my company, we use pkg/errors to wrap our errors, giving them context and a stack trace. This has been a sore point when using the FDB Golang client as we initially thought we wouldn’t be able to wrap any errors within a
But, I recently realized that it seems all retryable errors are either returned by the
Get() methods or by the transaction’s
Commit() method. Is this statement true?
If it is true, then within a
Transact() call, it should be safe to use the following rule: Always use the
MustGet() method variant and wrap every error. This would work because all retryable errors would be communicated via a panic instead of a returned value.
Does this make sense as a best practice?