clj-commons/clj-http-lite

Remove slingshot to make clj-http-lite dependency-free?

borkdude opened this issue ยท 3 comments

I have a fork of clj-http-lite which can be run with babashka. What I needed to do:

babashka@f44ebe4

  • remove the dependency on slingshot since that's not available in babashka:
  • remove references to javax.xml (this assumes a minimal Java version of 1.8)

Would you consider removing slingshot from this fork of clj-http-lite so we can use the "official" martinklepsch/clj-http-lite in babashka?

Yes, sounds good.

I think this would be a breaking change which is unfortunate. I would probably be ok with that though. ๐Ÿ‘

vemv commented

Probably breaking the API would be overly risky as it's perfectly possible that multiple dependencies on a given classpath depend on different clj-http-lite versions

I'll try to contribute a PR offering extra namespaces (and demoting the slingshot to :provided)

I think I found a reasonable solution:

4f2e2a8

Instead of throw+ we can simply use ex-info + the response in the data. This should behave the same as slingshot's throw+. The tests pass and I don't think we introduced any breaking changes with this, so the discussion can be closed imo.