Package akka.javasdk

Class SanitizerException

Object
Throwable
Exception
RuntimeException
akka.javasdk.SanitizerException
All Implemented Interfaces:
Serializable

public final class SanitizerException extends RuntimeException
Exception for a sanitizer that fails while it masks text. It includes the name of the sanitizer.

When the runtime masks the text of an agent request, the request fails, and the runtime does not pass the text on. The function given to onFailure of the agent receives this exception. The caller of the agent does not.

A call of SanitizerClient fails with this exception when the sanitizer is a class that fails or returns null.

The cause is the exception that the sanitizer failed with, or null when the masked text is null. The message of the cause can hold the text that the sanitizer was masking. Do not log the cause, and do not return its message to the caller.

See Also:
  • Constructor Details

    • SanitizerException

      public SanitizerException(String message, String sanitizerName, Throwable cause)
  • Method Details

    • getSanitizerName

      public String getSanitizerName()
      Returns the configured name of the sanitizer that failed.
      Returns:
      the sanitizer name