Conversation
…g functional, replace usage and refactor unit tests
|
Claude finished @austin-denoble's task —— View job PR Code Review - Refactor / fix
|
…g functional, replace usage and refactor unit tests
|
Claude finished @austin-denoble's task —— View job PR Code Review - Refactor / fix
|
Problem
Previously, I refactored the
exitpackage a bit to expose functions that wrappedzerolog. This seemed clever at the time, but I ended up introducing a bug where chainingexit.Error().Err(error)...would return azerolog.Eventinstead of an exitEvent, which meant the process wouldn't actually exit. This could lead to odd logging and behavior include sigsev violations.Solution
Reflecting on this code, the implementation seemed a bit too fancy and error-prone. I simplified things down to functions that do the same thing as the previous builder pattern-style
exitEvent.Replaced all usages of
exit.Error()andexit.Success(), updated unit tests to validate new functions.There larger scale changes I'd like to take on involving error handling and logging in later PRs.
Type of Change
Test Plan
CI - unit and integration tests
Testing involves generally triggering error and success messages that are meant to end the process.
A good example is calling
$ pc target --org my-org --project invalid-project-name- this will throw an error which would cause a sigsev:Before:

After:
