Skip to content

refactor: improve logging for unimplemented ErrorTranslator in TranlateError config enabled#7225

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
Invidam:improve-log-in-translate-error-config
Oct 9, 2024
Merged

refactor: improve logging for unimplemented ErrorTranslator in TranlateError config enabled#7225
jinzhu merged 1 commit intogo-gorm:masterfrom
Invidam:improve-log-in-translate-error-config

Conversation

@Invidam
Copy link
Copy Markdown
Contributor

@Invidam Invidam commented Oct 6, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested
    • test if the dummyDialector has no Translate(), occur warning log. (in TestDialectorWithErrorTranslatorSupport())

What did this pull request do?

If the user's config conficts with db driver's dialector implementation, a warning log will be generate to heldy identify the issue.

User Case Description

I enable TranslateError config as true, but my MySQL DB driver (version:1.4.7) doesn't implement Transalte() method.
Therefore, I had trouble identifying this situation. I think log information is necessary.

@jinzhu jinzhu merged commit 8020e8c into go-gorm:master Oct 9, 2024
jdon added a commit to incident-io/gorm that referenced this pull request Jan 9, 2026
This reverts the following commits:
- a1a3311 Revert change to replace directive
- 11ee137 Tidy struct scanner if statement
- 23b45b7 Run go fmt ./...
- 0fc283c Merge remote-tracking branch 'upstream/master'
- bf5cd45 Merge pull request #1 from incident-io/henrycourse/upgrade-gorm-ww24
- 65bfeca Revert go.mod migration to 1.2x+
- 52e3b35 refactor(workflow): update release workflow to enhance automation (go-gorm#7224)
- 8020e8c refactor: improve logging for unimplemented ErrorTranslator in TranslateError config (go-gorm#7225)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants