Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PromiseKit 6.2.5 #848

Closed
JQHee opened this issue May 2, 2018 · 2 comments
Closed

PromiseKit 6.2.5 #848

JQHee opened this issue May 2, 2018 · 2 comments

Comments

@JQHee
Copy link

JQHee commented May 2, 2018

PromiseKit 6.2.5 swift 4.1 xcode9
PromiseKit 4.1.7 is normal.

code:

extension Request {
    var promise: Promise<Response> {
        return Promise<Response> { fulfill, reject in
            NetworkManager.center.send(request: self, progress: nil, task: nil, handler: { (result: RequestResult<Response>) in
                switch result {
                case .success(model: let model):
                    fulfill(model)
                case .failure(error: let error):
                    reject(error)
                }
            })
        }
    }
}
DebugConstructionPlanListRequest(token: token, userId: userID, pagination: requestPagination).promise
    .then { [weak self] (projectList: DebugConstructionPlanListRequest.Response) in
        self?.didGetDataSuccessful(dataModel: projectList.data, nextIndex: 2, totalCount: projectList.totalCount)
    }.catch { [weak self] (error: Error) in
        self?.tableView.mj_header.endRefreshing()
        NetworkFailureUniversalProcess(error: error)
    }

error 1:

Cannot convert value of type '(DebugConstructionPlanListRequest.Response) -> ()?' (aka '(DubugConstructionPianListModel) -> Optional<()>') to expected argument type '(_) -> _'

error2:

Missing argument for parameter #4 in call Insert ', <#(Self.T) throws -> U#>'
HYBaseDictionaryRequest(EnCode: NetworkDictionary.projectStatus.rawValue).promise
    .then { [weak self] (response: HYBaseDictionaryRequest.Response) in
        self?.didGetProjectStatusSuccessful(projectStatus: response.data, hud: hud)
    }.catch { (error: Error) in
        NetworkFailureUniversalProcess(error: error)
    }
@mxcl
Copy link
Owner

mxcl commented May 2, 2018

Please indicate which lines the errors happen on.

@mxcl
Copy link
Owner

mxcl commented May 4, 2018

Read the migration guide for PMK 4 -> 6 or don't upgrade major versions of libraries.

@mxcl mxcl closed this as completed May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants