Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message when component returns nil #37

Open
slaughtlaught opened this issue Dec 3, 2024 · 0 comments · May be fixed by #39
Open

Confusing error message when component returns nil #37

slaughtlaught opened this issue Dec 3, 2024 · 0 comments · May be fixed by #39

Comments

@slaughtlaught
Copy link
Collaborator

slaughtlaught commented Dec 3, 2024

(ns myns
  (:require
   [darkleaf.di.core :as di]))

(defn ^{::di/kind :component} sys [{}]
  (println ">>> hello, world"))

@(di/start :sys {:sys (di/ref `sys)
                 `foo (di/ref `bar)})
;; >>> hello, world
; => ExceptionInfo: Missing dependency myns/sys
;    {:type  :darkleaf.di.core/missing-dependency
;     :stack (myns/sys :sys :darkleaf.di.core/implicit-root)}

"Missing dependency" ведет к дебагу в неправильном направлении, а именно поиску передачи зависимостей, хотя дело в том, что компонент ничего не вернул

@slaughtlaught slaughtlaught changed the title More obvious error message when object returns 'ni Confusing error message when object returns 'nil' Dec 3, 2024
@slaughtlaught slaughtlaught changed the title Confusing error message when object returns 'nil' Confusing error message when component returns nil Dec 3, 2024
@slaughtlaught slaughtlaught changed the title Confusing error message when component returns nil Confusing error message when component returns nil Dec 3, 2024
@darkleaf darkleaf linked a pull request Dec 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant