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

FailureJSONResponse #580

Closed
badmunkey opened this issue Aug 25, 2020 · 2 comments
Closed

FailureJSONResponse #580

badmunkey opened this issue Aug 25, 2020 · 2 comments

Comments

@badmunkey
Copy link

badmunkey commented Aug 25, 2020

I copied your syncAlamofire code from your project to my project.
I am seeing this error on line 69
Cannot convert value of type 'NSError' to expected argument type 'FailureJSONResponse'

60 func syncTypeUsingAlamofire(completion: @escaping (_ result: VoidResult) -> ()) {
61 Alamofire.request("http://dafounders.com/esogearcopytype.php").responseJSON { response in
62 if let jsonObject = response.result.value, let gearTypeJSON = jsonObject as? [[String: Any]] {
63 self.dataStack.sync(gearTypeJSON, inEntityNamed: GearType.entity().name!) { error in
64 completion(.success)
65
66
67 }
68 } else if let error = response.error {
69 completion(.failure(error as NSError))
70 } else {
71 fatalError("No error, no failure")
72 }

@badmunkey
Copy link
Author

NVM I figured it out. I see now that I did not include the ENUMS you had stated below in your Fetcher.swift file

@3lvis
Copy link
Owner

3lvis commented Aug 25, 2020

I'm glad you got it working

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