-
Notifications
You must be signed in to change notification settings - Fork 214
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
Improving error handling #92
Conversation
return err | ||
} | ||
specs := regexp.MustCompile("\n-+\n").Split(string(contents), -1) | ||
for _, spec := range specs { | ||
err = addYaml(spec) | ||
if err != nil { | ||
logrus.Errorf("Error parsing YAML %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this error will be logged twice (once in addYaml
), but maybe for the best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was intentional. I wanted to have more specific logging in addYaml
but also add this as a failsafe if an error hadn't already gotten logged there. It will likely be repetitive if they run into an error, but does ensure we catch things added to addYaml
in the future that may not get the same kind of logging in the future. I don't know, that could be overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 sounds good to me
@@ -89,10 +89,18 @@ func main() { | |||
if *webhook { | |||
startWebhookServer(c, *disableWebhookConfigInstaller, *webhookPort) | |||
} else if *dashboard { | |||
k, _ := kube.CreateResourceProvider(*auditPath) | |||
k, err := kube.CreateResourceProvider(*auditPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will get logged twice as well.
d959109
to
40bb07b
Compare
There were a number of places where errors were not being logged or displayed, this should fix a bunch of them.