### Question:
GoogleCustomSearcher extends AbstractMultifacetSearcher<WebContent> { static void checkError(String jsonString) throws SearcherException { if (StringUtils.isBlank(jsonString)) { throw new SearcherException("JSON response is empty."); } try { JsonObject jsonObject = new JsonObject(jsonString); JsonObject jsonError = jsonObject.getJsonObject("error"); if (jsonError != null) { int errorCode = jsonError.getInt("code"); String message = jsonError.getString("message"); throw new SearcherException("Error from Google Custom Search API: " + message + " (" + errorCode + ")."); } } catch (JsonException e) { throw new SearcherException("Could not parse JSON response ('" + jsonString + "').", e); } } GoogleCustomSearcher(String apiKey, String searchEngineIdentifier);  GoogleCustomSearcher(Configuration configuration); @Override String getName(); @Override SearchResults<WebContent> search(MultifacetQuery query); static final String CONFIG_API_KEY; static final String CONFIG_SEARCH_ENGINE_IDENTIFIER; }### Answer:
@Test public void testParsingErrorResponse() throws IOException { String jsonString = FileHelper.readFileToString(ResourceHelper .getResourceFile("/apiresponse/googleCustomSearchErrorResponse.json")); try { GoogleCustomSearcher.checkError(jsonString); fail(); } catch (SearcherException e) { assertEquals("Error from Google Custom Search API: Invalid Value (400).", e.getMessage()); } }