Allow enabling TranslateError
for session too instead of only globally
#7253
Labels
type:feature_request
feature request
Describe the feature
Allow enabling
TranslateError
forgorm.Session
instead of only globally (gorm.Config
)Motivation
I'd like to enable
TranslateError
option for a session instead of globally. I want to be able detect duplicate key error across dialects but without enabling it for the entire app as translated error loses the useful information like why the duplicate key information was raised.It would be nicer if gorm errors had
Unwrap()
method implemented but they don't and probably won't.Example usage:
Workaround is to modify the copied Config manually:
Related Issues
Didn't find related issues
The text was updated successfully, but these errors were encountered: