performWithExceptionHandling function

void performWithExceptionHandling (String name, void work(), void close())

Implementation

void performWithExceptionHandling(
    String name, void Function() work, void Function() close) {
  try {
    Timeline.startSync(name);
    work();
  } catch (_e) {
    handleException(name, _e, close);
    rethrow;
  } finally {
    Timeline.finishSync();
  }
}