Class UnhandledConfigResourceIdentifierException

  • All Implemented Interfaces:
    java.io.Serializable

    public class UnhandledConfigResourceIdentifierException
    extends java.lang.RuntimeException
    No config source could be found that knows how to read a resource identifier.

    Distinct from the identifier naming something that is not there, which is ordinary absence: a resource path may legitimately go unsatisfied, and MConfig skips it. This says something stronger — that nothing in the library, and nothing any ExtraPropertiesConfigSources declared on the CLASSPATH, recognizes the identifier at all. In practice it usually means a typo, or a jar that was expected to supply a reader and did not.

    That distinction is the reason this type exists. Reading a list of resource paths records each path's outcome — read, vetoed, not found, or faulted — and an unreadable identifier belongs in the fault bucket rather than among the merely absent. Before this type, such an identifier arrived as a FileNotFoundException and was filed as absence, so a mistake in a deployment's configuration was reported as the benign case.

    A RuntimeException because it is a programming or deployment error rather than a condition a caller should be made to handle at every call. It does not escape a read: it is caught per path, recorded against that path, and reported. Code that merely asks about an identifier rather than reading it — ConfigUtils.pointsToVetoableConfig, for instance — catches it and answers in the negative, leaving the complaint to whoever actually performs the read.

    See Also:
    Serialized Form
    • Method Summary

      • Methods inherited from class java.lang.Throwable

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

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

      • UnhandledConfigResourceIdentifierException

        public UnhandledConfigResourceIdentifierException​(java.lang.String message,
                                                          java.lang.Throwable cause)
      • UnhandledConfigResourceIdentifierException

        public UnhandledConfigResourceIdentifierException​(java.lang.String message)