package com.helpshift.network; import com.helpshift.network.HSResponse; import com.helpshift.network.exception.HSRootApiException; import com.helpshift.network.exception.NetworkException; import com.helpshift.util.Utils; /* loaded from: classes3.dex */ public class AuthenticationFailureNetwork implements HSNetwork { public final HSNetwork network; public AuthenticationFailureNetwork(HSNetwork hSNetwork) { this.network = hSNetwork; } @Override // com.helpshift.network.HSNetwork public HSResponse makeRequest(HSRequestData hSRequestData) { HSResponse makeRequest = this.network.makeRequest(hSRequestData); if (makeRequest.getStatus() == HSResponse.NetworkResponseCodes.UNAUTHORIZED_ACCESS.intValue() && !Utils.isEmpty(makeRequest.getResponseString())) { if ("missing user auth token".equalsIgnoreCase(makeRequest.getResponseString())) { NetworkException networkException = NetworkException.AUTH_TOKEN_NOT_PROVIDED; networkException.serverStatusCode = HSResponse.NetworkResponseCodes.AUTH_TOKEN_NOT_PROVIDED.intValue(); throw HSRootApiException.wrap(null, networkException); } if ("invalid user auth token".equalsIgnoreCase(makeRequest.getResponseString())) { NetworkException networkException2 = NetworkException.INVALID_AUTH_TOKEN; networkException2.serverStatusCode = HSResponse.NetworkResponseCodes.INVALID_AUTH_TOKEN.intValue(); throw HSRootApiException.wrap(null, networkException2); } } return makeRequest; } }