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.
|
/// A descriptive message describing the error.
|
||||||
final String message;
|
final String message;
|
||||||
|
|
||||||
ValidationException(this.message, {List<String> errors = const []})
|
ValidationException(this.message, {Iterable<String> errors = const []})
|
||||||
: super(FormatException(message),
|
: super(FormatException(message),
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
errors: errors ?? [],
|
errors: (errors ?? <String>[]).toSet().toList(),
|
||||||
stackTrace: StackTrace.current) {
|
stackTrace: StackTrace.current) {
|
||||||
if (errors != null) this.errors.addAll(errors);
|
if (errors != null) this.errors.addAll(errors);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue