Skip to content

Commit badf39c

Browse files
committed
Improve error descriptions.
1 parent 48dc40d commit badf39c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ extension ParseLiveQuery: LiveQuerySocketDelegate {
344344
guard let parseError = try? ParseCoding.jsonDecoder().decode(ParseError.self, from: data) else {
345345
//Turn LiveQuery error into ParseError
346346
let parseError = ParseError(code: .unknownError,
347-
message: "LiveQuery error code: \(error.code) message: \(error.error)")
347+
message: "ParseLiveQuery error code: \(error.code), message: \(error.error)")
348348
self.notificationQueue.async {
349349
self.receiveDelegate?.received(parseError)
350350
}
@@ -532,7 +532,7 @@ extension ParseLiveQuery {
532532
self.resumeTask()
533533
self.attempts += 1
534534
let error = ParseError(code: .unknownError,
535-
message: "Attempted to open socket \(self.attempts) time(s)")
535+
message: "ParseLiveQuery Error: attempted to open socket \(self.attempts) time(s)")
536536
completion(error)
537537
}
538538
}
@@ -572,7 +572,7 @@ extension ParseLiveQuery {
572572
} else {
573573
let error = ParseError(code: .unknownError,
574574
// swiftlint:disable:next line_length
575-
message: "Socket status needs to be \"\(URLSessionTask.State.running.rawValue)\" before pinging server. Current status is \"\(self.task.state.rawValue)\". Try calling \"open()\" to change socket status.")
575+
message: "ParseLiveQuery Error: socket status needs to be \"\(URLSessionTask.State.running.rawValue)\" before pinging server. Current status is \"\(self.task.state.rawValue)\". Try calling \"open()\" to change socket status.")
576576
pongReceiveHandler(error)
577577
}
578578
}

Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class ParseLiveQueryCombineTests: XCTestCase {
9292
return
9393
}
9494
XCTAssertEqual(parseError.code, ParseError.Code.unknownError)
95-
XCTAssertTrue(parseError.message.contains("Socket status"))
95+
XCTAssertTrue(parseError.message.contains("socket status"))
9696
}
9797
expectation1.fulfill()
9898

Tests/ParseSwiftTests/ParseLiveQueryTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class ParseLiveQueryTests: XCTestCase {
444444
return
445445
}
446446
XCTAssertEqual(parseError.code, ParseError.Code.unknownError)
447-
XCTAssertTrue(parseError.message.contains("Socket status"))
447+
XCTAssertTrue(parseError.message.contains("socket status"))
448448
expectation1.fulfill()
449449
}
450450
wait(for: [expectation1], timeout: 20.0)

0 commit comments

Comments
 (0)