Skip to content

Commit e2675fa

Browse files
committed
fix lint
1 parent bc04fd1 commit e2675fa

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

Sources/ParseSwift/API/URLSession+extensions.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,9 @@ extension URLSession {
4040
return try .success(mapper(responseData))
4141
} catch {
4242
if var error = try? ParseCoding.jsonDecoder().decode(ParseError.self, from: responseData) {
43-
do {
44-
let json = try JSONSerialization.jsonObject(with: responseData, options: []) as? [String : Any]
45-
if let code = json?["code"] as? Int {
46-
error.intCode = code
47-
}
48-
} catch {
49-
/* */
43+
if let json = try? JSONSerialization.jsonObject(with: responseData, options: []) as? [String: Any],
44+
let code = json["code"] as? Int {
45+
error.intCode = code
5046
}
5147
return .failure(error)
5248
}

Sources/ParseSwift/Types/ParseError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Foundation
1414
public struct ParseError: ParseType, Decodable, Swift.Error {
1515
public let code: Code
1616
public let message: String
17-
public var intCode: Int? = nil
17+
public var intCode: Int?
1818
public init(code: Code, message: String) {
1919
self.code = code
2020
self.message = message
@@ -353,7 +353,7 @@ public struct ParseError: ParseType, Decodable, Swift.Error {
353353
a non-2XX status code.
354354
*/
355355
case xDomainRequest = 602
356-
356+
357357
/**
358358
Error code indicating any other custom error sent from Parse Cloud
359359
*/

Tests/ParseSwiftTests/ParseCloudTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class ParseCloudTests: XCTestCase { // swiftlint:disable:this type_body_length
377377
}
378378
}
379379
}
380-
380+
381381
func jobAsync(serverResponse: [String: String], callbackQueue: DispatchQueue) {
382382

383383
let expectation1 = XCTestExpectation(description: "Logout user1")

0 commit comments

Comments
 (0)