Skip to content

Tracking errors and properly exiting with error code#37

Merged
sendqueery merged 1 commit intodisneystreaming:v1from
jschell12:error-codes
Sep 1, 2020
Merged

Tracking errors and properly exiting with error code#37
sendqueery merged 1 commit intodisneystreaming:v1from
jschell12:error-codes

Conversation

@jschell12
Copy link
Contributor

Ensure errors tracked to later exit properly with error code (1)
(wip)

@sendqueery sendqueery self-requested a review August 19, 2020 16:36
func (results *ResultSafe) Add(result *Result) {
results.Lock()
results.InvocationResults = append(results.InvocationResults, result)
results.Unlock()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unimportant potentially bikesheddy question so take worth a grain of salt, do we prefer defer for these kinda ops?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally prefer using defer but considering the proximity and how simple this function is I am impartial to its use here. When there is more code between the lock and unlock I think defer is always the best option

// Output our results
log.Infof(resultFormat, "Instance ID", "Region", "Profile", "Status")
for _, v := range output.InvocationResults {
switch v.Status {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason to move away from the switch/case statements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jordan and I paired on this. Not sure why I made the change either

@sendqueery sendqueery merged commit e65ae5e into disneystreaming:v1 Sep 1, 2020
sendqueery pushed a commit that referenced this pull request Sep 3, 2020
Co-authored-by: Josh Schell <joshua.schell@disneystreaming.com>
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.

4 participants