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 to SanitizerClient fails with this exception when the sanitizer is a TextSanitizer that fails or returns null.

The cause is the exception that the sanitizer failed with. The cause can be null, for example when the sanitizer returned 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 of your component.

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