bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

"WARNING: doo's init function was not set" is misleading #122

Closed thedavidmeister closed 6 years ago

thedavidmeister commented 7 years ago
(defn ^:export run! [a]
  (try
    (*main-cli-fn* a)
    (catch :default e
      (println "WARNING: doo's init function was not set")
      (println e)
      (exit! false))))

This just means that literally any error will print this warning, it does not mean that the init function wasn't set.

bensu commented 7 years ago

Hi,

Thanks for the report. Can you show me an example of an error and its cause that was unrelated to the message? It would be helpful to decide where/if to put that message.

thedavidmeister commented 7 years ago

@bensu I literally just had an error in my own code. The cause was a mistake i made.

bensu commented 7 years ago

Hi,

Great! Can you give me a small project that shows that error?

laurentsenta commented 7 years ago

https://xkcd.com/979/

I get the same warning in my tests.

bensu commented 7 years ago

Hi @Isenta

Would you mind providing a repo that shows the error?

laurentsenta commented 7 years ago

Hi @bensu I put some details in: https://github.com/bensu/doo/issues/134

thedavidmeister commented 7 years ago

this looks like an example https://github.com/bensu/doo/pull/141

MatthewDarling commented 7 years ago

In terms of improving the messaging here, is there more than (println e) that is specific to the actual problem that happened? I tried (println (.-stack e)) but I don't know if that works in all environments.

I've opened #151 to avoid printing the "init function was not set" when it doesn't apply. But if there's other low-hanging fruit to improve the default exception handler, now's a good time to address that :)

miikka commented 6 years ago

I think that PR #151 (included in release 0.1.8) addressed this issue, so I'll close this.