callUseCase method

  1. @override
Future<Either<Exception, dynamic>> callUseCase(
  1. String id,
  2. Map<String, dynamic> json
)
override

Implementation

@override
Future<Either<Exception, dynamic>> callUseCase(
    String id, Map<String, dynamic> json) async {
  try {
    final usecase = getUseCase(id);
    final params = _useCaseParamsMapper.fromID(id, json);
    return usecase.call(params) as Future<Either<Exception, dynamic>>;
  } catch (e) {
    return Left(Exception('Error executing use case id: $id, error: $e'));
  }
}