It's better to simply return the errors that occur from Tx.CreateBucket()
and Bucket.Put()
because they will rollback the transaction and the error will be returned from DB.Update()
. Then you can just check the error from DB.Update()
.
The DB.Update()
can also fail (e.g. the disk write may fail) so you should always check the return error from it.