adamtornhill / code-maat

A command line tool to mine and analyze data from version-control systems

Home Page:http://www.adamtornhill.com/code/codemaat.htm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improving IllegalArgumentException error message when passing wrong parameters

knorrium opened this issue · comments

I invoked code-maat with a wrong parameter (-a couplin instead of -a coupling) and it threw the following exception:

java.lang.IllegalArgumentException: Internal error - please report it. Details = Wrong number of args (1) passed to: app/make-analysis/fn--8124
    at code_maat.app.app$throw_internal_error.invoke(app.clj:158)
    at code_maat.app.app$run_with_recovery_point.invoke(app.clj:167)
    at code_maat.app.app$run.invoke(app.clj:188)
    at code_maat.cmd_line$_main.doInvoke(cmd_line.clj:63)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at code_maat.cmd_line.main(Unknown Source)
Error:  Internal error - please report it. Details = Wrong number of args (1) passed to: app/make-analysis/fn--8124

It would be good to know that "couplin" is invalid and what the valid options are :)

I've improved the error message. An invalid analysis request now results in the following message:

Invalid argument:  Invalid analysis requested: couplin. 
 Valid options are: soc, fragmentation, main-dev-by-revs, refactoring-main-dev, entity-churn, authors, entity-effort, coupling, author-churn, summary, identity, revisions, communication, entity-ownership, messages, abs-churn, main-dev

Thanks for reporting this!

@adamtornhill wow, that was fast! :D Thanks for the quick fix. I started reading your book today, so expect some more reports soon :)