Source:
protected NoticeReportResult submitError(final Throwable error, final io.honeybadger.reporter.dto.Request request, final String message, final Set<String> tags) { final String errorClassName = error.getClass().getName(); if (errorClassName != null && getConfig().getExcludedClasses().contains(errorClassName)) { return null; } final Notice notice = new Notice(getConfig()); if (request != null) { final String reportedMessage; if (message != null && !message.isEmpty()) { reportedMessage = message; } else { reportedMessage = parseMessage(error); } NoticeDetails noticeDetails = new NoticeDetails( getConfig(), error, tags, reportedMessage); notice.setRequest(request).setError(noticeDetails); } else { NoticeDetails noticeDetails = new NoticeDetails(getConfig(), error, tags); notice.setError(noticeDetails); } String json; try { json = OBJECT_MAPPER.writeValueAsString(notice); } catch (JsonProcessingException e) { logger.error("JSON Serialization of the Notice Failed.", e); logger.error("Original Error", error); return null; } for (int retries = 0; retries < RETRIES; retries++) { try { HttpResponse response = sendToHoneybadger(json) .returnResponse(); int responseCode = response.getStatusLine().getStatusCode(); if (responseCode != HttpStatus.SC_CREATED) { logger.error("Honeybadger did not respond with the " + "correct code. Response was [{}]. Retries={}", responseCode, retries); } else { UUID id = parseErrorId(response); return new NoticeReportResult(id, notice, error); } } catch (IOException e) { String msg = String.format("There was an error when trying " + "to send the error to " + "Honeybadger. Retries=%d", retries); logger.error(msg, e); logger.error("Original Error", error); return null; } } return null; }

Target:
protected NoticeReportResult submitError(final Throwable error, final io.honeybadger.reporter.dto.Request request, final String message, final Set<String> tags) { final String errorClassName = error.getClass().getName(); if (errorClassName != null && getConfig().getExcludedClasses().contains(errorClassName)) { return null; } final Notice notice = new Notice(getConfig()); if (request != null) { final String reportedMessage; if (message != null && !message.isEmpty()) { reportedMessage = message; } else { reportedMessage = parseMessage(error); } NoticeDetails noticeDetails = new NoticeDetails( getConfig(), error, tags, reportedMessage); notice.setRequest(request).setError(noticeDetails); } else { NoticeDetails noticeDetails = new NoticeDetails(getConfig(), error, tags); notice.setError(noticeDetails); } String json; try { json = OBJECT_MAPPER.writeValueAsString(notice); } catch (JsonProcessingException e) { logger.error("JSON Serialization of the Notice Failed.", e); logger.error("Original Error", error); return null; } for (int retries = 0; retries <= config.getMaximumErrorReportingRetries(); retries++) { try { HttpResponse response = sendToHoneybadger(json) .returnResponse(); int responseCode = response.getStatusLine().getStatusCode(); if (responseCode != HttpStatus.SC_CREATED) { logger.error("Honeybadger did not respond with the " + "correct code. Response was [{}]. Retries={}, Maximum={}", responseCode, retries, config.getMaximumErrorReportingRetries()); } else { UUID id = parseErrorId(response); return new NoticeReportResult(id, notice, error); } } catch (IOException e) { String msg = String.format("There was an error when trying " + "to send the error to " + "Honeybadger. Retries=%d, Maximum=%d", retries, config.getMaximumErrorReportingRetries()); logger.error(msg, e); logger.error("Original Error", error); } } return null; }