Calling the methods (all probably) with wrong client id or api-key does not give an error, but returns nil. Example:
(images "wrong" "credentials")
=> nil
I debugged this and it looks like the eror detection does not work. In the case of wrong credentials the "error" variable is nil, as there is no "error" key in the "resp" response:
{:opts {:url https://api.digitalocean.com/images?client_id=asdadasd&api_key=asdasdasda, :method :get}, :body {"status":"ERROR","error_message":"Access Denied","message":"Access Denied"}, :headers {:status 401 Unauthorized, :cf-ray 16944c251322091a-CDG, :date Sat, 13 Sep 2014 12:20:12 GMT, :server cloudflare-nginx, :set-cookie __cfduid=d0b327a4dd476fc65c01880514eaf694b1410610811696; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly, :connection keep-alive, :cache-control no-cache, :x-request-id 4996bdea865b3983954dee40f509f5b5, :content-type application/json; charset=utf-8, :x-rack-cache miss, :x-runtime 0.009625, :transfer-encoding chunked}, :status 401}
This error could be detected by checking for http status 401.