mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-27 19:17:06 +02:00
refactor logging functions
This commit is contained in:
@@ -58,7 +58,9 @@ public extension NSManagedObjectContext {
|
||||
}
|
||||
if fetchResults == nil {
|
||||
|
||||
HardcoreData.handleError(error!, "Failed executing fetch request.")
|
||||
HardcoreData.handleError(
|
||||
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
|
||||
"Failed executing fetch request.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -90,7 +92,9 @@ public extension NSManagedObjectContext {
|
||||
}
|
||||
if fetchResults == nil {
|
||||
|
||||
HardcoreData.handleError(error!, "Failed executing fetch request.")
|
||||
HardcoreData.handleError(
|
||||
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
|
||||
"Failed executing fetch request.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -120,7 +124,9 @@ public extension NSManagedObjectContext {
|
||||
}
|
||||
if count == NSNotFound {
|
||||
|
||||
HardcoreData.handleError(error!, "Failed executing fetch request.")
|
||||
HardcoreData.handleError(
|
||||
error ?? NSError(hardcoreDataErrorCode: .UnknownError),
|
||||
"Failed executing fetch request.")
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user