@Test public void returnsAErrorReportedProperlyIfTheResponseStatusCodeIsNotAnError() throws Exception { enqueueMockResponse(CREATED_CODE); ApiClientResult<Object> result = apiClient.reportError(ANY_EXCEPTION); assertTrue(result.isSuccess()); }
public ApiClientResult<Object> reportError(Throwable t) { Request request = generateCreateErrorReportRequest(t); try { Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { response.close(); return new ApiClientResult<>(new Object()); } } catch (IOException e) { return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR); } return new ApiClientResult<>(ApiClientResult.Error.UNKNOWN); }
CrashReporterApiClient extends ApiClient { public ApiClientResult<Object> reportError(Throwable t) { Request request = generateCreateErrorReportRequest(t); try { Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { response.close(); return new ApiClientResult<>(new Object()); } } catch (IOException e) { return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR); } return new ApiClientResult<>(ApiClientResult.Error.UNKNOWN); } }
CrashReporterApiClient extends ApiClient { public ApiClientResult<Object> reportError(Throwable t) { Request request = generateCreateErrorReportRequest(t); try { Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { response.close(); return new ApiClientResult<>(new Object()); } } catch (IOException e) { return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR); } return new ApiClientResult<>(ApiClientResult.Error.UNKNOWN); } CrashReporterApiClient(String apiKey, Device device, String scheme, String host, int port,
      boolean debugEnabled); }
CrashReporterApiClient extends ApiClient { public ApiClientResult<Object> reportError(Throwable t) { Request request = generateCreateErrorReportRequest(t); try { Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { response.close(); return new ApiClientResult<>(new Object()); } } catch (IOException e) { return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR); } return new ApiClientResult<>(ApiClientResult.Error.UNKNOWN); } CrashReporterApiClient(String apiKey, Device device, String scheme, String host, int port,
      boolean debugEnabled); ApiClientResult<Object> reportError(Throwable t); }
CrashReporterApiClient extends ApiClient { public ApiClientResult<Object> reportError(Throwable t) { Request request = generateCreateErrorReportRequest(t); try { Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { response.close(); return new ApiClientResult<>(new Object()); } } catch (IOException e) { return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR); } return new ApiClientResult<>(ApiClientResult.Error.UNKNOWN); } CrashReporterApiClient(String apiKey, Device device, String scheme, String host, int port,
      boolean debugEnabled); ApiClientResult<Object> reportError(Throwable t);  }