Skip to content

Comments

Validation warnings#73

Open
featalion wants to merge 5 commits intopapertrail:masterfrom
featalion:fix-issue-43
Open

Validation warnings#73
featalion wants to merge 5 commits intopapertrail:masterfrom
featalion:fix-issue-43

Conversation

@featalion
Copy link
Contributor

Print configuration file validation warnings if:

  • no files to watch supplied
  • port is not defined, when host is

Exit with error code if no files to watch specified at all (in config and via command line).

Related to #43

Copy link
Contributor

Choose a reason for hiding this comment

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

@leonsodhi: Do you think this is worth printing?

Choose a reason for hiding this comment

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

I'd say the more error handling the better. Silence is a right PITA to troubleshoot, and means we have no error message to work from when customers get in touch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Works for me

@troy
Copy link
Contributor

troy commented Jun 19, 2015

@leonsodhi: Code looks good to me. Can you edit the error messages (and if you think they can be clearer, comments), either by merging and creating a new branch+PR or by branching from this branch?

@featalion
Copy link
Contributor Author

@leonsodhi @troy I added more validation warnings. They will come before daemonization on parent stage or if no daemonization required. To determine the stage, I updated VividCortex/godaemon dependency. This update is workaround for #23 .

@troy
Copy link
Contributor

troy commented Jun 23, 2015

@leonsodhi this looks good to me other than wording and grammar on the error strings and error code variable name ("Exists"). If it saves you time to put revisions in here for Yury to implement, go for it.

Choose a reason for hiding this comment

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

It's totally fine for someone to only pass in params via the CLI switches and not have a config file. I'd vote for removing this warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If user misplaced config file, there is no way to know that. In common, users do not read the code to understand why utility fails. They write to support. One notification line can save your and users' time.

Choose a reason for hiding this comment

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

Completely agree on users not wanting to read code on failures, and they definitely shouldn't have to. However, IMO, we should validate that all required parameters have been supplied and not worry about where they came from. If a user specifies all required parameters via the CLI, a config file isn't necessary and thus we can't justify suggesting something is wrong.

The only situation I can think of where this falls down is when an optional parameter is specified in a config file and r_s2 is never asked to load it. One solution to that might be printing the state of all settings when -D is used. I'd prefer to hold off doing that ATM as it hasn't been something that comes up in practice. We can always revisit if things change.

Let me know if I've missed a scenario here or there's a hole in my logic.

@featalion
Copy link
Contributor Author

Summing all comments above, do you want to have -D option for validations warnings? Defaults to false.

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