NSLocalizedDescriptionKey

This commit is contained in:
Gwendal Roué committed 2017-08-18 14:20:35 +02:00
1 parent badec62cdd
commit 2fd071d90e
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -411,7 +411,7 @@ class DatabaseAggregateTests: GRDBTestCase {
func testAggregateStepThrowingCustomError() throws {
struct Aggregate : DatabaseAggregate {
func step(_ dbValues: [DatabaseValue]) throws {
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSString(string: NSLocalizedDescriptionKey): "custom error message"])
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSLocalizedDescriptionKey: "custom error message"])
}
func finalize() -> DatabaseValueConvertible? {
fatalError()
@@ -502,7 +502,7 @@ class DatabaseAggregateTests: GRDBTestCase {
struct Aggregate : DatabaseAggregate {
func step(_ dbValues: [DatabaseValue]) { }
func finalize() throws -> DatabaseValueConvertible? {
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSString(string: NSLocalizedDescriptionKey): "custom error message"])
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSLocalizedDescriptionKey: "custom error message"])
}
}
let dbQueue = try makeDatabaseQueue()
+1 -1
View File
@@ -335,7 +335,7 @@ class DatabaseFunctionTests: GRDBTestCase {
func testFunctionThrowingCustomError() throws {
let dbQueue = try makeDatabaseQueue()
let fn = DatabaseFunction("f") { dbValues in
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSString(string: NSLocalizedDescriptionKey): "custom error message"])
throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSLocalizedDescriptionKey: "custom error message"])
}
dbQueue.add(function: fn)
try dbQueue.inDatabase { db in