guardCaptureAsync<T> function

Future<T?> guardCaptureAsync<T>(
  1. Future<T> body()
)

Implementation

Future<T?> guardCaptureAsync<T>(Future<T> Function() body) async {
  try {
    return await body();
  } catch (e, st) {
    if (kDebugMode) {
      debugPrint('[Interceptly] capture failed (request unaffected): $e\n$st');
    }
    return null;
  }
}