Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Sources/Segment/Utilities/JSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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

Expand Down