Pulse
Pulse copied to clipboard
Crash for users with no diskspace
The NSManagedContext.save() throws an NSException which causes a crash during flush() if a users device is full.
3 CoreData 0x1ab5788f4 -[NSPersistentStoreCoordinator _introspectLastErrorAndThrow] + 104 (NSPersistentStoreCoordinator.m:0)
4 CoreData 0x1ab578f6c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.967 + 1256 (NSPersistentStoreCoordinator.m:0)
5 CoreData 0x1ab405324 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 260 (NSPersistentStoreCoordinator.m:598)
6 CoreData 0x1ab4061ec -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1260 (NSPersistentStoreCoordinator.m:3068)
7 CoreData 0x1ab406218 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1304 (NSPersistentStoreCoordinator.m:3672)
8 CoreData 0x1ab407258 -[NSManagedObjectContext save:] + 1244 (NSManagedObjectContext.m:1577)
9 AppName 0x104bffb30 closure #1 in LoggerStore.flush(_:) + 244 (LoggerStore.swift:385)
Unfortunately, there is no way to capture Objective-C exceptions from Swift, and I don't know any better ways to handle it. I'd like to avoid turning PulseCore into a mixed Objective-C and Swift target if possible.
Would something like https://stackoverflow.com/a/32991585/442695 work?
Yes, but that would require making the project a mixed Swift/ObjC framework, which I would ideally like to avoid.