exceptionHandler<T> method

Future<T> exceptionHandler<T>(
  1. FutureOr computation, {
  2. String unknownMessage = 'Hycop Exception',
})

Implementation

Future<T> exceptionHandler<T>(
  FutureOr computation, {
  String unknownMessage = 'Hycop Exception',
}) async {
  try {
    return await computation;
    // } on AppwriteException catch (e) {
    //   trace.warning(e.message, e);
    //   throw RepositoryException(message: e.message ?? 'An undefined error occured');
  } on Exception catch (e, st) {
    logger.severe(unknownMessage, e, st);
    throw HycopException(message: unknownMessage, exception: e, stackTrace: st);
  }
}