-
Notifications
You must be signed in to change notification settings - Fork 55
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
Dr2 2049 make number of displayed errors configurable #527
Dr2 2049 make number of displayed errors configurable #527
Conversation
def rowCallback(row: ValidatedNel[FailMessage, Any]): Unit = row match { | ||
val maxNumOfLines = Try(potentialMaxNumOfLines.toInt) match { | ||
case Success(number) if number > 0 => number | ||
case _ => |
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.
I think if we error finding the limit, we should, perhaps, just go ahead with the current default limit of 2000 instead of setting it to zero. Maybe get Steve's opinion as well.
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.
The reason I set it to 0 here is so that on line 154, it can do the conditional check maxNumOfLines > 0
and not run the validation (after it sends the error message on line 151). Wouldn't it be better to just return an error rather than running the validation?
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.
My thinking is, it becomes more restrictive than previous version, also if that setting is missing, the application can still carry on and succeed, hence the comment. Perhaps get Steve's opinion as well.
val maxNumOfLines = Try(potentialMaxNumOfLines.toInt) match { | ||
case Success(number) if number > 0 => number | ||
case _ => | ||
toConsole("Error: Maximum number of lines to display must be a positive whole number starting from 1") |
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.
Perhaps a simpler message "should be more than zero" or something like that. Technically, "whole numbers" include zero
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.
Ah yes. 😄 I was going back and forth trying to make this message more succinct; yours is much better.
csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala
Outdated
Show resolved
Hide resolved
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.
A couple of comments and one to seek another opinion.
No description provided.