onyx icon indicating copy to clipboard operation
onyx copied to clipboard

Invalid lifecycle keys throws a bad exception

Open MichaelDrogalis opened this issue 10 years ago • 7 comments

Fix this to throw the proper malformed key.

MichaelDrogalis avatar Jan 04 '16 15:01 MichaelDrogalis

This is a great example of something we could do. Elm has some really nice features that make it easy for newbies. I assume it does some fuzzy matching. I believe we should show the options not just our best guess though.

cwshq5ou8aath6m

lbradstreet avatar Jan 04 '16 16:01 lbradstreet

I think I have a fast (not necessarily nice) implementation of the levenshtein distance that I'd like to put to test. Do you think this would be a newbie ticket that I could take on?

lenaschoenburg avatar Jan 04 '16 18:01 lenaschoenburg

@dignati Let's do fuzzy suggestion on #467 - give it a shot. If things get hairy, fall back to clj-fuzzy.

MichaelDrogalis avatar Jan 04 '16 18:01 MichaelDrogalis

Oops, didn't realise #467 was tracked on a separate issue. :+1:

lbradstreet avatar Jan 04 '16 19:01 lbradstreet

I started working on this one. I stopped - someone else should do this one. I'd like to see the improved error messages used (seen here] for lifecycle-calls, and for the rest of the job data structures. It would be ideal to do this in one shot on this ticket

MichaelDrogalis avatar Jan 05 '16 02:01 MichaelDrogalis

What would you prefer, rich ex-infos or more prosa in the exception description? ex-info could look like this:

clojure.lang.ExceptionInfo: Catalog is missing :onyx/name values for the following workflow keywords: 
    data: {:missing-keys (:in-bootstrapped :inc :inc), :suggestions {:in-bootstrapped ("intermediate" "out" "in"), :inc ("in" "out" "intermediate")}}

lenaschoenburg avatar Jan 05 '16 20:01 lenaschoenburg

I'd prefer to keep it as data with ex-info. A use case I have in mind is propagating the ex-data back into ClojureScript.

MichaelDrogalis avatar Jan 05 '16 20:01 MichaelDrogalis