diff --git a/Package.swift b/Package.swift index abe05d19..c5460e1c 100644 --- a/Package.swift +++ b/Package.swift @@ -23,7 +23,7 @@ let package = Package( .package( name: "Sovran", url: "https://github.com/segmentio/Sovran-Swift.git", - from: "1.0.2" + from: "1.0.3" ) ], targets: [ diff --git a/Segment.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Segment.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4e9f23ef..78657c8b 100644 --- a/Segment.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Segment.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "git@github.com:segmentio/Sovran-Swift.git", "state": { "branch": null, - "revision": "be79aad4393d36959f422c2b40566b84ee1170f7", - "version": "1.0.2" + "revision": "944c17d7c46bd95fc37f09136cabd172be5b413b", + "version": "1.0.3" } } ] diff --git a/Sources/Segment/Utilities/JSON.swift b/Sources/Segment/Utilities/JSON.swift index 006b4a9c..6d35d76a 100644 --- a/Sources/Segment/Utilities/JSON.swift +++ b/Sources/Segment/Utilities/JSON.swift @@ -21,6 +21,7 @@ public enum JSON: Equatable { private enum JSONError: Error { case unknown case nonJSONType(type: String) + case incorrectType } public init(_ object: [String: Any]) throws { @@ -302,7 +303,7 @@ extension JSON { newArray.append(value) result = try JSON(newArray) default: - throw "This JSON object is not an array type." + throw JSONError.incorrectType } return result } @@ -325,7 +326,7 @@ extension JSON { newObject[key] = value result = try JSON(newObject) default: - throw "This JSON object is not an array type." + throw JSONError.incorrectType } return result } @@ -347,7 +348,7 @@ extension JSON { newObject.removeValue(forKey: key) result = try JSON(newObject) default: - throw "This JSON object is not an array type." + throw JSONError.incorrectType } return result