fastlane/swift/SocketResponse.swift in fastlane_hotfix-2.165.1 vs fastlane/swift/SocketResponse.swift in fastlane_hotfix-2.187.0
- old
+ new
@@ -1,7 +1,7 @@
// SocketResponse.swift
-// Copyright (c) 2020 FastlaneTools
+// Copyright (c) 2021 FastlaneTools
//
// ** NOTE **
// This file is provided by fastlane and WILL be overwritten in future updates
// If you want to add extra functionality to this project, create a new file in a
@@ -11,11 +11,11 @@
import Foundation
struct SocketResponse {
enum ResponseType {
case parseFailure(failureInformation: [String])
- case failure(failureInformation: [String])
+ case failure(failureInformation: [String], failureClass: String?, failureMessage: String?)
case readyForNext(returnedObject: String?, closureArgumentValue: String?)
case clientInitiatedCancel
init(statusDictionary: [String: Any]) {
guard let status = statusDictionary["status"] as? String else {
@@ -38,10 +38,12 @@
guard let failureInformation = statusDictionary["failure_information"] as? [String] else {
self = .parseFailure(failureInformation: ["Ruby server indicated failure but Swift couldn't receive it"])
return
}
- self = .failure(failureInformation: failureInformation)
+ let failureClass = statusDictionary["failure_class"] as? String
+ let failureMessage = statusDictionary["failure_message"] as? String
+ self = .failure(failureInformation: failureInformation, failureClass: failureClass, failureMessage: failureMessage)
return
}
self = .parseFailure(failureInformation: ["Message status: \(status) not a supported status"])
}
}