tools.namespace

Show full path for circular dependency exceptions

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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]}

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: