Pulse icon indicating copy to clipboard operation
Pulse copied to clipboard

Crash for users with no diskspace

Open jostster opened this issue 3 years ago • 3 comments

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)

jostster avatar Feb 08 '22 01:02 jostster

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.

kean avatar Apr 29 '22 02:04 kean

Would something like https://stackoverflow.com/a/32991585/442695 work?

jostster avatar Sep 22 '22 16:09 jostster

Yes, but that would require making the project a mixed Swift/ObjC framework, which I would ideally like to avoid.

kean avatar Sep 29 '22 00:09 kean