ClojureScript

Bad Exception message when multimethod has no dispatch-fn

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

When a multi-fn has no dispatch method for a given value the current exception string prints the cljs.core/name function instead of the actual name of the mf. Minor bug but makes it kinda hard to track down which multi-fn actually failed to dispatch.

The attached patch fixes that but directly accessing the name property of the multi-fn which is not very clean but better than the current error. AFAICT cljs doesnt have the clojure.lang.Named protocol, which would probably be cleaner.

Activity

Thomas Heller made changes -
Field Original Value New Value
Attachment cljs-multifn-ex-message.patch [ 11847 ]
Thomas Heller made changes -
Attachment cljs-multifn-ex-message.patch [ 11848 ]
Thomas Heller made changes -
Attachment cljs-multi-fn-ex-msg-inamed.patch [ 11865 ]
Thomas Heller made changes -
Attachment cljs-multifn-ex-message.patch [ 11848 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: