Support for rollbacktransactionwith details variant #3881
Replies: 3 comments 3 replies
-
It's not necessary to have this details in the diesel provided error type as you can easily supply your own error type. The documentation states the function signature of fn transaction<T, E, F>(&mut self, f: F) -> Result<T, E>where
F: FnOnce(&mut Self) -> Result<T, E>,
E: From<Error>, which clearly shows that you can return any custom error type from the closure as long as it implements Also the documentation clearly states that the transaction will be rolled back for any error returned from the closure, not only for
(Again from the linked documentation) To summarize that all: You can just return your error type directly as long as |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It's quite evident that you (and not I) haven't grasped the current gap problem in transforming one error into another without a suitable semantic variant like RollbackWithDetails that can carry error details. Instead, I will use SerializationError, even though it doesn't provide a better solution, as it supports carrying errors internally. However, observing the way you repeatedly emphasize the same arguments, it's apparent that we're not making progress. When acting as the maintainer of any open-source project, it's crucial to listen to others rather than adopting an ironic mindset that assumes you're the only one with intelligence, while others are lazy, don't read documentation, or lack an understanding of obvious things |
Beta Was this translation helpful? Give feedback.
-
Its possible add to diesel error variants
RollbackTransactionWithDetails(Box<dyn StdError + Send + Sync>)
. I have some cases that we want rollback for some outside db transaction reasons and want to track details about reasons later like map_err ...current support RollbackTransaction seem does not help much in this cases. I can write PR if you guys want
Beta Was this translation helpful? Give feedback.
All reactions