Class ContextReportingParsingErrorHandler$

java.lang.Object
org.apache.pekko.http.ParsingErrorHandler
org.apache.pekko.http.impl.engine.server.ContextReportingParsingErrorHandler$

public class ContextReportingParsingErrorHandler$ extends ParsingErrorHandler
Renders what the handler was told about the request that was rejected
  • Field Details

  • Constructor Details

    • ContextReportingParsingErrorHandler$

      public ContextReportingParsingErrorHandler$()
  • Method Details

    • handle

      public HttpResponse handle(StatusCode status, ErrorInfo error, org.apache.pekko.event.LoggingAdapter log, ServerSettings settings)
      Specified by:
      handle in class ParsingErrorHandler
    • handle

      public HttpResponse handle(StatusCode status, ErrorInfo error, org.apache.pekko.event.LoggingAdapter log, ServerSettings settings, IllegalRequestContext context)
      Description copied from class: ParsingErrorHandler
      Called by the server for a request that failed to parse, with what is known about that request.

      The default implementation ignores context and delegates to the four-argument handle, so existing handlers keep working unchanged; override this method instead to make use of the context. The parameter is still worth passing for a handler that does not read it, because the arguments of this method are visible to anything instrumenting it: the OpenTelemetry Java agent has to name the span it emits for a rejected request HTTP and report neither http.request.method nor url.path, since the four-argument signature describes only the failure and never the request that caused it. See {@link https://github.com/apache/pekko-http/issues/1245}.

      Note that DefaultParsingErrorHandler deliberately keeps implementing the four-argument method rather than this one, so that advice matching that signature keeps firing.

      Overrides:
      handle in class ParsingErrorHandler
      Parameters:
      status - (undocumented)
      error - (undocumented)
      log - (undocumented)
      settings - (undocumented)
      context - (undocumented)
      Returns:
      (undocumented)