# performWithExceptionHandling function | |
void performWithExceptionHandling | |
(String name, void work(), void close()) | |
<p>Wraps work with common try/catch behaviour and timeline events.</p> | |
## Implementation | |
```dart | |
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(); | |
} | |
} | |
``` | |