-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor generate_queries devops case to use errs
Previously the devops use case generation code used a call to log.Fatalf when something went wrong. This makes it awkward to test error conditions when generating queries from other packages, since we need a way to (a) replace the unexported call to log.Fatalf and (b) prevent the runtime from actually quitting. It is better for the library to actually return errors on calls that can fail, rather than either fataling or panicking. Now other packages can handle the errors themselves and also test error conditions in their packages as well. This refactor was pruned a bit to bubble the 'panic' up one level for now. When the actual generation code encounters the error during normal execution, it will panic. But these are easier to test for and don't require adding hooks to replace the 'fatal' path in the original package.
- Loading branch information
1 parent
3cad7a8
commit 3ba75f6
Showing
9 changed files
with
247 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.