Class ScanViewConfigRunValidationException

  • All Implemented Interfaces:
    java.io.Serializable

    
    public class ScanViewConfigRunValidationException
    extends RuntimeException
                        

    Thrown when a scan view configuration is valid against the JSON schema but cannot actually run on this build.

    Schema validation only checks the shape of the configuration. Run validation additionally checks that whatever the configuration asks for is available at runtime — today, the opt-in Google ML Kit modules (see MlKitModuleMissing).

    Run validation happens while the configuration is read, before any scanning starts: ScanView.init(...) wraps this in a RuntimeException, so read it from the cause; ScanViewConfigHolder.validateJsonObject instead reports it as ScanViewConfigHolder.ScanViewJsonValidationResult.ValidationFailed. Pass validateForRun = false to skip run validation and check the schema only.

    These exceptions are thrown by the SDK; integrators catch them rather than construct them.

    Unchecked on purpose. A missing opt-in module is a build configuration mistake, not a condition a caller can recover from at runtime, and the documented entry point ScanView.init(...) already surfaces it as an unchecked RuntimeException. Making it checked would force a catch on the secondary entry points only, which is where the @Throws declarations on ScanViewConfigHolder.fromJsonObject come in: they keep the exception visible in the signature without making it a compile error for Java callers.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class ScanViewConfigRunValidationException.MlKitModuleMissing

      A feature was enabled in the configuration without its Google ML Kit module on the runtime classpath.

      Google ML Kit is an opt-in dependency: the SDK declares it compileOnly, so an integrator adds it only for the feature they use (see MSDK-1548). Rather than silently disabling the feature, the SDK fails so the misconfiguration cannot ship unnoticed. The message names the missing module and how to resolve it.

      Catch this type to handle either module being absent, or the subtypes to tell them apart.

    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class kotlin.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail