Normally we use Retrofit or Volley library for API call. However, in this PR we try to use the built-in classes to do that.
We added one more library called coroutines, which is used to handle the asynchronous operation.
There are some reasons for the error to occur:
No internet connectivity
API call returns < 200 or >= 300
Receives 200, but the response contains error or errors fields
JSON parsing error
Currently, all of the above errors are just thrown as Exception. We don't differentiate them by creating some custom Exception classes because afaik, there is still no use case for that.
Normally we use Retrofit or Volley library for API call. However, in this PR we try to use the built-in classes to do that. We added one more library called
coroutines
, which is used to handle the asynchronous operation.There are some reasons for the error to occur:
error
orerrors
fieldsCurrently, all of the above errors are just thrown as
Exception
. We don't differentiate them by creating some custom Exception classes because afaik, there is still no use case for that.