Skip to content
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

[cfg] More user-friendly configuration parsing error messages #709

Closed
vankoven opened this issue Mar 17, 2017 · 1 comment
Closed

[cfg] More user-friendly configuration parsing error messages #709

vankoven opened this issue Mar 17, 2017 · 1 comment

Comments

@vankoven
Copy link
Contributor

Patch set #707 fixed issue #65, but TODO suggestions are not implemented.

  1. Don't write configuration parsing errors directly to log, write into error string buffer inside of TfwCfgEntry instead. Display them in print_parse_error. In current implementation user gets 1-3 messages explaining why string from configuration file contain errors followed by message showing error line number and line itself. Also more user friendly messages are preferred, possibly with valid examples.

E.g. transform current output:

[tempesta] ERROR: invalid number of values; expected: 1, got: 0
[tempesta] ERROR: Unable to parse 'listen' value: 'No value specified'
[tempesta] ERROR: configuration parsing error:
                  5: listen; # 80;
                     ^^^^^^^^^^^^^
[tempesta] ERROR: failed to start modules

Into this:

[tempesta] ERROR: configuration parsing error:
                  5: listen; # 80;
                     ^^^^^^^^^^^^^
               Required argument is not set: port number or IP address and port pair.
               Examples:
                   listen 80;
                   listen 443 proto=https;
                   listen [::0]:80;
                   listen 127.0.0.1:8001;
                   listen [::1]:8001;
[tempesta] ERROR: failed to start modules
  1. Indicate the token caused parsing error, e.g:
[tempesta] ERROR: configuration parsing error:
                  5: listen aa;
                            ^^
               Invalid value: expected port number or IP address and port pair.
               Examples:
                   listen 80;
                   listen 443 proto=https;
                   listen [::0]:80;
                   listen 127.0.0.1:8001;
                   listen [::1]:8001;
[tempesta] ERROR: failed to start modules
@krizhanovsky krizhanovsky added this to the 0.6 WebOS milestone Mar 17, 2017
@krizhanovsky krizhanovsky modified the milestones: backlog, 1.0 Web Server, 1.0 Web Operating System, 0.9 Web server Jan 9, 2018
@krizhanovsky krizhanovsky modified the milestones: 1.3 Web server, 1.2 TDB v0.2 Aug 8, 2018
@krizhanovsky krizhanovsky modified the milestones: 1.2 TDB v0.2, 1.1 QUIC Nov 25, 2018
@krizhanovsky krizhanovsky modified the milestones: 1.1 QUIC, 1.0 Beta Nov 29, 2018
@krizhanovsky krizhanovsky modified the milestones: 1.0 Beta, 0.9 TDBv0.2 Feb 2, 2019
@krizhanovsky
Copy link
Contributor

We need to fully rework current configuration handling (see #67 and #862 ), so there is no sense to fix the small problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants