Closed ChristopherBiscardi closed 11 years ago
I'm getting this error when trying to retrieve an existing user from the sandbox.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException ... Caused by: java.lang.reflect.InvocationTargetException ... Caused by: java.lang.NullPointerException at com.braintreegateway.CreditCard.getPayroll(CreditCard.java:299) ...
with this Clojure code:
(def gateway (new BraintreeGateway Environment/SANDBOX "xxx" "xxx" "xxx")) (defpage [:post "/btreeuser"] {:keys [userid securitytag]} (if (and (not (nil? userid)) (= "xxx" securitytag)) (try (let [user (from-java (.. gateway customer (find userid)))] (response/json {:success true :user user})) (catch com.braintreegateway.exceptions.NotFoundException e (response/json {:success false :msg "Not Found"}))) (response/json {:success false})))
I'm 99% sure I haven't changed any relevant code since the last time it worked. I'm using noir (defpage) if that matters and the exception catches successfully if the user doesn't exist. Using lib v2.18.0
Wiped all systems data and the issue went away. Still not sure what was causing it though.
I'm getting this error when trying to retrieve an existing user from the sandbox.
with this Clojure code:
I'm 99% sure I haven't changed any relevant code since the last time it worked. I'm using noir (defpage) if that matters and the exception catches successfully if the user doesn't exist. Using lib v2.18.0