Skip to content

Commit

Permalink
Remove do-catch and fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kvld committed Nov 6, 2022
1 parent 5cf20a1 commit 241748a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Sources/XCResultKit/Schema/ActionTestExpectedFailure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ public struct ActionTestExpectedFailure: XCResultObject {
public let failureSummary: ActionTestFailureSummary?
public let isTopLevelFailure: Bool

public init?(_ json: [String: AnyObject]) {
do {
uuid = xcOptional(element: "uuid", from: json)
failureReason = xcOptional(element: "failureReason", from: json)
failureSummary = xcOptional(element: "failureSummary", from: json)
isTopLevelFailure = xcOptional(element: "isTopLevelFailure", from: json) ?? false
} catch {
logError("Error parsing ActionTestExpectedFailure: \(error.localizedDescription)")
return nil
}
public init(_ json: [String: AnyObject]) {
uuid = xcOptional(element: "uuid", from: json)
failureReason = xcOptional(element: "failureReason", from: json)
failureSummary = xcOptional(element: "failureSummary", from: json)
isTopLevelFailure = xcOptional(element: "isTopLevelFailure", from: json) ?? false
}
}

0 comments on commit 241748a

Please sign in to comment.