-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
If we supply nil to a conversion function, it throws an AssertionError
(csk/->kebab-case-keyword nil)
Execution error (AssertionError) at camel-snake-kebab.core/->kebab-case-keyword (core.cljc:21).
Assert failed: (clojure.core/not (clojure.core/nil? s__20671__auto__))
(cske/transform-keys csk/->kebab-case-keyword {nil "bar"})
Execution error (AssertionError) at camel-snake-kebab.core/->kebab-case-keyword (core.cljc:21).
Assert failed: (clojure.core/not (clojure.core/nil? s__20671__auto__))We had an issue in production where this happened w/ some unexpected input and since it is an Error and not an Exception some things we're not handled properly.
Does it make sense to return nil on nil input? This feels a bit more idiomatic clojure usage to me.
Error : An Error “indicates serious problems that a reasonable application should not try to catch.”
Exceptions : An Exception “indicates conditions that a reasonable application might want to catch.”
At the very least throwing IllegalArgumentException or something may be better than an AssertionError?
Metadata
Metadata
Assignees
Labels
No labels