-
Notifications
You must be signed in to change notification settings - Fork 56
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
base: release/4.2
Are you sure you want to change the base?
Conversation
…ng directive or there is a syntax error in the directive typed
wrangler-core/src/main/java/io/cdap/wrangler/registry/UserDirectiveRegistry.java
Outdated
Show resolved
Hide resolved
if (!status.isSuccess()) { | ||
StringBuilder eStr = new StringBuilder(); | ||
Iterator<SyntaxError> errors = status.getErrors(); | ||
while (errors.hasNext()) { |
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.
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?
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.
@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.
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.
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.
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.
No, we terminate on first one.
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.
then why bother iterating through all of these and concatenating instead of just getting the first one?
@albertshau PTAL. |
if (!status.isSuccess()) { | ||
StringBuilder eStr = new StringBuilder(); | ||
Iterator<SyntaxError> errors = status.getErrors(); | ||
while (errors.hasNext()) { |
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.
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.
wrangler-core/src/main/java/io/cdap/wrangler/registry/UserDirectiveRegistry.java
Outdated
Show resolved
Hide resolved
wrangler-core/src/main/java/io/cdap/wrangler/registry/UserDirectiveRegistry.java
Outdated
Show resolved
Hide resolved
@albertshau PTAL. |
…ng directive or there is a syntax error in the directive typed