Uploaded image for project: 'tools.namespace'
  1. TNS-49

Show full path for circular dependency exceptions

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None

      Description

      I use org.clojure/tools.namespace "0.3.0-alpha4" to detect circular dependencies among arbitrary objects. It works fine, but the error could be more informative for a certain case:

      {:type clojure.lang.ExceptionInfo
         :message "Circular dependency between x and y"
         :data {:reason :clojure.tools.namespace.dependency/circular-dependency, :node x, :dependency y}
         :at [clojure.core$ex_info invokeStatic "core.clj" 4617]}
      

      x and y are redacted data.

      The problem is that neither x or y depend on each other directly, but via an indirect path.

      It would be tremendously useful if the exception itself informed of the full faulty path, instead of just the beginning and end.

      Example of desired exception:

       :data {:reason :clojure.tools.namespace.dependency/circular-dependency, :node x, :dependency y, :path [x a b c y]}
       

        Attachments

          Activity

            People

            • Assignee:
              stuart.sierra Stuart Sierra
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: