returnResponse method
Implementation
@override
dynamic returnResponse(Response response) {
switch (response.statusCode) {
case 200:
case 201:
return response.data;
case 400:
throw BadRequestException(response.data.toString());
case 401:
case 403:
throw UnauthorisedException(response.data.toString());
case 500:
default:
throw FetchDataException(
'Error occured while communication with server with status code : ${response.statusCode}');
}
}