handle method

  1. @override
Future handle(
  1. Context context,
  2. dynamic data
)
override

Implementation

@override
Future handle(Context context, data) async {
  final exceptions = <Exception>[];
  for (final schema in schemas) {
    try {
      await schema.handle(context, data);
    } on Exception catch (e) {
      exceptions.add(e);
    }
  }

  if (exceptions.isEmpty) return data;
  throw OvOException(
    code: #all_of,
    message: message ?? 'All schemas must be valid',
    exceptions: exceptions,
  );
}