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

user-friendly config error message (#249) #312

Merged
merged 2 commits into from
Apr 18, 2013

Conversation

y-oda-oni-juba
Copy link
Contributor

modify jubaservers and jubaconfig json-config parse error like this:

syntax error in configuration: <PATH>:<LINENO>:<POS> <MESSAGE...>

jubaservers exit immediately with exit-code 1 on json-config parse error.

@ghost ghost assigned kmaehashi Apr 11, 2013
@@ -76,6 +76,19 @@ class server_helper {
}
// send error message to caller
throw JUBATUS_EXCEPTION(config_error);
} catch (const pfi::lang::parse_error& e) {
// exit immediately on JSON parse error with exit-code 1
Copy link
Member

Choose a reason for hiding this comment

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

Currently,

  • Syntax errors: print user-friendly message and call exit(1)
  • Semantics errors: throw exception, prints stack trace and aborts

I think it is better to display user-friendly message in both cases.
How about changing the behaviour of the semantics errors to display user-friendly message too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think so. I will change semantics errors behavior.

Furthermore, I think any user-operation errors should be reported by user-friendly message and exit(1).
Examples:

  • Currently, when user start servers with same port, server throws exception and aborts.

Copy link
Member

Choose a reason for hiding this comment

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

Agree! So,

  • let's fix JSON syntax/semantic error messages in this issue, and
  • raise new issue for refactoring to solve exit()ing in everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Umm... jsonconfig semantics errors (exceptions) are confused:

  • jsonconfig::config_error exception classes are defined but used
  • config semantics errors are reported by jubatus::config_exception, fv_converter::converter_exception, jubatus::unsupported_method ... and more???

y-oda-oni-juba added a commit that referenced this pull request Apr 18, 2013
user-friendly config error message (#249)
@y-oda-oni-juba y-oda-oni-juba merged commit 2cc3257 into jubatus:develop Apr 18, 2013
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.

2 participants