<commit_before>package org.fedorahosted.flies.rest.client;

import java.net.URL;
import java.util.Arrays;

import javax.ws.rs.core.Response;

import org.jboss.resteasy.client.core.BaseClientResponse;

public class ClientUtility
{
   public static void checkResult(Response response, URL url)
   {
      if (response.getStatus() >= 399)
      {
         String annots = "";
         String entity = "";
         if (response instanceof BaseClientResponse)
         {
            BaseClientResponse resp = (BaseClientResponse) response;
            annots = Arrays.asList(resp.getAnnotations()).toString();
            try
            {
               entity = ", entity: " + resp.getEntity(String.class);
            }
            catch (Exception e)
            {
               entity = "";
            }
         }
         throw new RuntimeException("operation returned " + response.getStatus() + ": " + Response.Status.fromStatusCode(response.getStatus()) + entity + ", url: " + url + ", annotations: " + annots);
      }
   }
}<commit_msg>Reduced verbosity of client-side errors<commit_after>package org.fedorahosted.flies.rest.client;

import java.net.URL;
import java.util.Arrays;

import javax.ws.rs.core.Response;

import org.jboss.resteasy.client.core.BaseClientResponse;

public class ClientUtility
{
   public static void checkResult(Response response, URL url)
   {
      if (response.getStatus() >= 399)
      {
         String annotString = "";
         String urlString = "";
         if (response instanceof BaseClientResponse)
         {
            BaseClientResponse<?> resp = (BaseClientResponse<?>) response;
            annotString = ", annotations: " + Arrays.asList(resp.getAnnotations()).toString();
         }
         if (url != null)
         {
            urlString = ", url: " + url;
         }
         String msg = "operation returned " + response.getStatus() + ": " + Response.Status.fromStatusCode(response.getStatus()) + urlString + annotString;
         throw new RuntimeException(msg);
      }
   }
}
{'fraction_non_alphanumeric': 0.1182531894013739, 'fraction_numerical': 0.002944062806673209, 'mean_word_length': 2.348111658456486, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3440606', 'n_tokens_mistral': 569, 'n_tokens_neox': 554, 'n_words': 115}