Codota Logo
ApiExceptionHandlerUtils
Code IndexAdd Codota to your IDE (free)

How to use
ApiExceptionHandlerUtils
in
com.nike.backstopper.handler

Best Java code snippets using com.nike.backstopper.handler.ApiExceptionHandlerUtils (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: Nike-Inc/riposte

@SafeVarargs
protected final List<Pair<String, String>> withBaseExceptionMessage(
  Throwable ex, Pair<String, String>... extraLogMessages
) {
  List<Pair<String, String>> logPairs = new ArrayList<>();
  ApiExceptionHandlerUtils.DEFAULT_IMPL.addBaseExceptionMessageToExtraDetailsForLogging(ex, logPairs);
  if (extraLogMessages != null) {
    logPairs.addAll(Arrays.asList(extraLogMessages));
  }
  return logPairs;
}
origin: Nike-Inc/riposte

protected final Pair<String, String> causeDetailsForLogs(Throwable orig) {
  Throwable cause = orig.getCause();
  String causeDetails = (cause == null) ? "NO_CAUSE" : cause.toString();
  return Pair.of("exception_cause_details",
          ApiExceptionHandlerUtils.DEFAULT_IMPL.quotesToApostrophes(causeDetails));
}
origin: com.nike.backstopper/backstopper-core

/**
 * @return All the headers in the given request as a comma-separated list of name=value in string form.
 *          Multi-value headers will come back in name=[value1,value2] form.
 *          NOTE: This method never throws an exception. If it catches one it will return blank string "" instead.
 */
public String parseRequestHeadersToString(RequestInfoForLogging request) {
  try {
    Map<String, List<String>> headers = request.getHeadersMap();
    if (headers == null || headers.isEmpty())
      return "";
    Set<String> headerNames = headers.keySet();
    StringBuilder sb = new StringBuilder();
    boolean first = true;
    for (String headerName : headerNames) {
      if (!first)
        sb.append(",");
      sb.append(parseSpecificHeaderToString(request, headerName));
      first = false;
    }
    return sb.toString();
  }
  catch(Exception ex) {
    return "";
  }
}
origin: com.nike.backstopper/backstopper-core

String traceId = extractDistributedTraceId(request);
String requestUri = request.getRequestUri();
String requestMethod = request.getRequestHttpMethod();
String queryString = request.getQueryString();
String headersString = parseRequestHeadersToString(request);
String contributingErrorsString = concatenateErrorCollection(contributingErrors);
origin: com.nike.backstopper/backstopper-core

    + "details of the request along with the full stack trace of the original exception. "
    + "unfiltered_api_errors=%s",
    trackingLogKey, trackingUuid.toString(), utils.concatenateErrorCollection(clientErrors)
  ));
  filteredClientErrors = Collections.singletonList(genericServiceError);
String errorId = utils.buildErrorMessageForLogs(
  logMessage, request, filteredClientErrors, highestPriorityStatusCode, coreException, extraDetailsForLogging
);
origin: com.nike.backstopper/backstopper-core

errorUid = utils.buildErrorMessageForLogs(
  baseLogMessageBuilder, request, errorsToUse, httpStatusCodeToUse, ex, extraDetailsForLogging
);
origin: com.nike.backstopper/backstopper-core

/**
 * Adds the given exception's {@link Exception#getMessage()} to the given extraDetailsForLogging with the key of
 * "exception_message" and with the exception's message pruned of quotes via {@link #quotesToApostrophes(String)}.
 */
public void addBaseExceptionMessageToExtraDetailsForLogging(Throwable ex,
                              List<Pair<String, String>> extraDetailsForLogging) {
  extraDetailsForLogging.add(Pair.of("exception_message", quotesToApostrophes(ex.getMessage())));
}
origin: com.nike.backstopper/backstopper-jaxrs

utils.addBaseExceptionMessageToExtraDetailsForLogging(ex, extraDetailsForLogging);
WebApplicationException webex = (WebApplicationException) ex;
Response webExResponse = webex.getResponse();
utils.addBaseExceptionMessageToExtraDetailsForLogging(ex, extraDetailsForLogging);
handledErrors = singletonSortedSetOf(projectApiErrors.getMalformedRequestApiError());
origin: com.nike.backstopper/backstopper-core

  Pair.of("serverside_validation_errors", utils.quotesToApostrophes(sb.toString()))
);
origin: com.nike.backstopper/backstopper-core

   .append("|").append(violation.getMessage());
extraDetailsForLogging.add(Pair.of("constraint_violation_details", utils.quotesToApostrophes(sb.toString())));
com.nike.backstopper.handlerApiExceptionHandlerUtils

Javadoc

Set of reusable utility methods used by the API exception handling chain ( com.nike.backstopper.handler.ApiExceptionHandlerBase, com.nike.backstopper.handler.UnhandledExceptionHandlerBase, and the various com.nike.backstopper.handler.listener.ApiExceptionHandlerListener implementations).

Most used methods

  • addBaseExceptionMessageToExtraDetailsForLogging
    Adds the given exception's Exception#getMessage() to the given extraDetailsForLogging with the key o
  • quotesToApostrophes
  • buildErrorMessageForLogs
    Creates a UUID to use as the unique request ID for this request and attaches it to the given StringB
  • concatenateErrorCollection
  • extractDistributedTraceId
  • parseRequestHeadersToString
  • parseSpecificHeaderToString

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Reference (javax.naming)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now