Interface ErrorMapper

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ErrorMapper
Service hook that replaces the error HttpTransport derived from a failed response, for vendor-specific mapping (for example a 403 that means bad credentials, or a 500 whose body says the request will never succeed). Set it with TransportConfig.Builder.errorMapper.

The mapper runs for every response whose status the request does not accept, before the retry decision and before Hooks.onError(codes.grow.packages.skywalking.core.Hooks.ErrorInfo), so hooks and callers see the mapped error. A mapped error with retryable() == false stops the retries; a retryable one keeps the SPEC retry rules of the status. The mapper must keep messages redacted: build them with HttpTransport.errorMessage(java.lang.String, int, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, byte[], java.util.Collection<java.lang.String>) rather than from the raw body.

  • Field Details

    • NONE

      static final ErrorMapper NONE
      Keeps the default error.
  • Method Details