Class CspViolationException

All Implemented Interfaces:
Serializable

public class CspViolationException extends IllegalStateException
Thrown in the CspMode.STRICT Content Security Policy mode by an API that sends JavaScript to the browser as a string, such as Element.executeJs(String, Object...). The browser would compile such a string with new Function, which a strict policy without unsafe-eval blocks, so the call fails on the server instead, where the stack trace points at the code that made it.

The stack trace starts at the API and leads to the code that called it.

Since:
25.4
See Also:
  • Constructor Details

    • CspViolationException

      public CspViolationException(String message)
      Creates a new exception with the given detail message.
      Parameters:
      message - the detail message, not null