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

[CDAP-15407] When a wrong directive is typed in CDAP/Wrangler no error message is displayed to user. #403

Open
wants to merge 4 commits into
base: release/4.2
Choose a base branch
from

Conversation

nitinmotgi
Copy link
Contributor

@nitinmotgi nitinmotgi commented May 2, 2020

…ng directive or there is a syntax error in the directive typed

  • Merge to release/4.2
  • Updated JIRA with test results (CDAP-15407)
  • Locally tested.

…ng directive or there is a syntax error in the directive typed
if (!status.isSuccess()) {
StringBuilder eStr = new StringBuilder();
Iterator<SyntaxError> errors = status.getErrors();
while (errors.hasNext()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this could potentially result in a giant error message that covers the whole screen. Should we limit the number of errors in the message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@albertshau this is compile error. So, I don't expect it to be very long as compiler will terminate on first error, but can have two to three lines max.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there are 10 syntax errors in the recipe, won't this result in 10 error messages concatenated together with commas? And if each individual message has a comma or period or multiple sentences, this can very easily become unreadable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we terminate on first one.

Copy link
Contributor

Choose a reason for hiding this comment

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

then why bother iterating through all of these and concatenating instead of just getting the first one?

@nitinmotgi
Copy link
Contributor Author

@albertshau PTAL.

if (!status.isSuccess()) {
StringBuilder eStr = new StringBuilder();
Iterator<SyntaxError> errors = status.getErrors();
while (errors.hasNext()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If there are 10 syntax errors in the recipe, won't this result in 10 error messages concatenated together with commas? And if each individual message has a comma or period or multiple sentences, this can very easily become unreadable.

@nitinmotgi
Copy link
Contributor Author

@albertshau PTAL.

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