Class ExtHint

java.lang.Object
io.karatelabs.core.ExtHint

public final class ExtHint extends Object
Turns a bare ReferenceError: X is not defined inside a step into an actionable failure — when X is a global that an ext would have bound, had the project declared it.

An ext registers its globals when karate-boot.js calls boot.ext('<name>') (rules binds Rule, Schema, …). Leave that line out and every step touching the global fails with the bare JS error, which names the global but never the declaration that binds it — so the reader (or an LLM driving the run) hunts for a typo in the feature instead of adding one line to the boot file.

There is no catalogue of ext names here. Resolution walks BootBinding's own io.karatelabs.ext.<name>.<Name>Ext convention outward from the missing global, and speaks only when that class is genuinely on the classpath and the Suite did not already bind the name — so a hint is never invented for an ext this runtime cannot boot, and an ordinary typo stays an ordinary typo.

  • Method Details

    • decorate

      public static Throwable decorate(Throwable error, Suite suite)
      The step failure with the boot hint appended, or error itself when no hint applies — identity is the contract, the caller stores whatever comes back. The wrapper keeps the original as its cause and reuses its stack, so nothing about the origin is lost.
    • forError

      public static String forError(Throwable error, Suite suite)
      The hint line for this failure, or null when it is not a resolvable missing-ext global.