Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): moving the error handling for no changes to the correct place #70

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

Jacobbrewer1
Copy link
Owner

Describe your changes

This pull request includes a refactor of the Patch method in the templates/_update.tmpl file to improve error handling and code readability. The most important changes involve reordering the SQL generation and error handling logic.

Improvements to error handling and code readability:

  • The SQL generation step (res.GenerateSQL()) has been moved to occur after the initial error check for patcher.NewDiffSQLPatch, ensuring that the SQL generation is only attempted if the initial patch creation is successful.
  • Consolidated the error handling for the GenerateSQL method, simplifying the error message to "failed to generate patch" in both cases.

@Jacobbrewer1 Jacobbrewer1 enabled auto-merge (squash) January 29, 2025 08:10
@Jacobbrewer1 Jacobbrewer1 merged commit 4b92bcc into main Jan 29, 2025
5 checks passed
@Jacobbrewer1 Jacobbrewer1 deleted the fix/patch-errs branch January 29, 2025 08:11
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.

1 participant