Skip to content

Commit

Permalink
Fixes compile issue w/ throws using String:Error conformance. (#90)
Browse files Browse the repository at this point in the history
* Updated Sovran to remove string:error conformance.

* Package resolution

* Fixed throw calls that were using string:error.

Co-authored-by: Brandon Sneed <[email protected]>
  • Loading branch information
bsneed and Brandon Sneed authored Nov 2, 2021
1 parent 89430c1 commit 4aa4bc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "[email protected]:segmentio/Sovran-Swift.git",
"state": {
"branch": null,
"revision": "be79aad4393d36959f422c2b40566b84ee1170f7",
"version": "1.0.2"
"revision": "944c17d7c46bd95fc37f09136cabd172be5b413b",
"version": "1.0.3"
}
}
]
Expand Down
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

0 comments on commit 4aa4bc9

Please sign in to comment.