Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Catch errors thrown by http.ListenAndServe and quit Pulse if detected #430

Merged
merged 1 commit into from
Oct 23, 2015
Merged

Catch errors thrown by http.ListenAndServe and quit Pulse if detected #430

merged 1 commit into from
Oct 23, 2015

Conversation

geauxvirtual
Copy link
Contributor

Fixes #416

func monitorErrors(ch <-chan error) {
for {
select {
case _, ok := <-ch:
Copy link
Contributor

Choose a reason for hiding this comment

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

what is _, and ok in this context?

I'm asking, because I wonder if you need the loop. Could you not just:

func monitorErrors(ch <-chan error) {
    <-ch
    // maybe some logging about what happened
    os.Exit(1)
}

@pittma
Copy link
Contributor

pittma commented Oct 23, 2015

+1

geauxvirtual added a commit that referenced this pull request Oct 23, 2015
Catch errors thrown by http.ListenAndServe and quit Pulse if detected
@geauxvirtual geauxvirtual merged commit d937264 into intelsdi-x:master Oct 23, 2015
@geauxvirtual geauxvirtual deleted the tb/fix_416 branch November 3, 2015 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants