-
Notifications
You must be signed in to change notification settings - Fork 5
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
Nil component #39
base: master
Are you sure you want to change the base?
Nil component #39
Conversation
@KGOH @slaughtlaught fyi |
Co-authored-by: KGOH <[email protected]>
Co-authored-by: KGOH <[email protected]>
@@ -13,6 +13,11 @@ | |||
;; It throws with original exception. | |||
;; All other possible exceptions are added as suppressed. | |||
|
|||
(defn ex-map-wo-via [ex] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darkleaf обрати внимание, мб лучше можно сделать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KGOH @slaughtlaught you all could simple use ex-cause
(defn- validate-component-obj! [obj variable] | ||
(when (nil? obj) | ||
(throw (ex-info "A component fn should not return nil" | ||
{:variable variable})))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я не смог придумать нормальный :type
.
И там ниже в var->factory-defn
тоже нет type.
Если сможете придумать, будет здорово, нет - тоже ок.
(t/deftest nil-component-0-arity-test | ||
(let [ex (try-catch (di/start `nil-component-0-arity))] | ||
(t/is (= "An error during component build" (-> ex ex-message))) | ||
(t/is (= "A component fn should not return nil" (-> ex ex-cause ex-message))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use "must not"?
For example clojure.core
contains "must" several times.
closes #38
fixes #37