Dedupe error messages
This commit is contained in:
parent
5d8c2ae005
commit
b38905234c
1 changed files with 2 additions and 2 deletions
|
@ -382,10 +382,10 @@ class ValidationException extends AngelHttpException {
|
|||
/// A descriptive message describing the error.
|
||||
final String message;
|
||||
|
||||
ValidationException(this.message, {List<String> errors = const []})
|
||||
ValidationException(this.message, {Iterable<String> errors = const []})
|
||||
: super(FormatException(message),
|
||||
statusCode: 400,
|
||||
errors: errors ?? [],
|
||||
errors: (errors ?? <String>[]).toSet().toList(),
|
||||
stackTrace: StackTrace.current) {
|
||||
if (errors != null) this.errors.addAll(errors);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue