onError method
Called when an exception was occurred during the request.
Implementation
@override
void onError(DioError err, ErrorInterceptorHandler handler) {
super.onError(err, handler);
if (err.response != null) {
DioResponseParser().parser(err.response).then((ResponseModel responseModel) {
int? requestIndex = CommonData.requestingMap[err.requestOptions.hashCode];
if (requestIndex != null) {
CommonData.requestList[requestIndex].response = responseModel;
CommonData.requestingMap.remove(err.requestOptions.hashCode);
}
_updateRequest();
});
}
}