Skip to content

Conversation

@kefahB
Copy link
Contributor

@kefahB kefahB commented Feb 17, 2020

Hi @EddyVerbruggen

There is inconsistency between AFSuccess and AFFailure on the response .. of course I understand it is not the same .. but when dealing with REST API we expecting to get sometimes status response like 301 or 422... the problem it is the AFFailure return the content in a new object content.body .. when trying to do some check stuff, we xill need a lot of change in ours code to change response.content to `response.content.body'

I added a new objet 'failureinstead ofcontent` and keeping content he same as AFSuccess.

let failure: any = {
    body: content,
    description: error.description,
    reason: error.localizedDescription,
    url: error.userInfo.objectForKey('NSErrorFailingURLKey').description
  };


  resolve({task, content, reason, failure: failure});

@kefahB kefahB closed this Feb 17, 2020
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

Successfully merging this pull request may close these issues.

1 participant