skydoves / sandwich

🥪 Sandwich is an adaptable and lightweight sealed API library designed for handling API responses and exceptions in Kotlin for Retrofit, Ktor, and Kotlin Multiplatform.

Home Page:https://skydoves.github.io/sandwich/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get custom error from my server?

longdcnb1998 opened this issue · comments

When i call api to my server and handle error, i want to get my custom error message like this
}
"statusCode": 400,
"message": "Registered phone number"
}

But when i use sandwich lib, error message convert to [ApiResponse.Failure.Error-BadRequest](errorResponse=Response{protocol=http/1.1, code=400, message=Bad Request
I just want to get my message error "Registered phone number"

Hey @longdcnb1998, sorry for the late response. You can check out #8.