metosin / sieppari

Small, fast, and complete interceptor library for Clojure/Script
Eclipse Public License 2.0
207 stars 21 forks source link

Non AsyncContext & map-like contexts should fail fast #41

Open ikitommi opened 4 years ago

ikitommi commented 4 years ago

Currently, if a context is neither, it will do something undefined, most likely fails, but could just do nothing. If it's neither, we should blow up in a manged way, relevant code here: https://github.com/metosin/sieppari/blob/develop/src/sieppari/core.cljc#L36-L43

This happens for example when someone returns a core.async channel, without having it registered as a valid AsyncContext.

ikitommi commented 4 years ago

should be easy to fix, just change default protocol mappings to all map-like things and if -> cond.

tvaisanen commented 3 years ago

Looks like this one has already been fixed by: https://github.com/metosin/sieppari/commit/2fdfe7324251873a2bafada06a61f780fb5a32db#diff-0f6d587492626373d113ac119d5a735853fe1fb9212914a941858e4051269b08