``` { "status": false, "message": "Duplica...
# android
a
Copy code
{
  "status": false,
  "message": "Duplicate entry '@gmail.com' for key 'users_email_unique'"
}
Copy code
{
  "status": false,
  "message": {
    "code": "1048",
    "message": "Something goes wrong."
  }
}
g
It's not easy to handle such inconsistent API. But if you cannot fix this on server side... You can use some sort dynamic API (like parse to Map<Any, Any>)
Or use multi-step parsing to parse to corresponding error class, but still should check type on runtime
r
You would have to parse the json and check for the error body.Yea I agree API like this are annoying. They should just fail with a error code if something is wrong
But anyway, this is not in the scope of the chat lol.Wee I always tell you, Kotlin specific lol
a
@rkeazoraw! I'm so sorry Robert. 😞 I will be extra careful next time. My apologise.
@gildor thanks Andrey, definitely will try it out!
r
no need to apologize to me, i’m just reiterating the the channel rules lol. sooner or later we are going to have rename this channel to the slackoverflow channelstackoverflow🤦‍♀️
😂 2
😫 2