safeClose static method
Safely closes a resource with error handling
Implementation
static Future<void> safeClose(
Future<void> Function() closeOperation,
String resourceName,
) async {
try {
await closeOperation();
_logger.fine('[UDXExceptionUtils] Successfully closed $resourceName');
} catch (error) {
_logger.warning('[UDXExceptionUtils] Error closing $resourceName: $error');
// Don't rethrow - we want cleanup to continue
}
}