                                                                                   :stack-trace (stack-trace)})))
                                            resp))
           wrap-exception-reponse (fn [resp] ((http/wrap-exceptions (constantly resp)) (assoc req :throw-exceptions true)))
-          configurator (configurator req)
+          ^HystrixCommand$Setter configurator (configurator req)
           logging-context (or (MDC/getCopyOfContextMap) {})
           command (proxy [HystrixCommand] [configurator]
                     (getFallback []
                       (MDC/setContextMap logging-context)
                       (log-error (:hystrix/command-key req) this)
-                      (let [exception (.getFailedExecutionException this)
+                      (let [exception (.getFailedExecutionException ^HystrixCommand this)
                             response (when exception (get-thrown-object exception))]
                         (fallback req response)))
                     (run []

        (.andCommandPropertiesDefaults command-configurator)
        (.andThreadPoolPropertiesDefaults thread-pool-configurator))))

(defn ^:private log-error [command-name context]
  (let [message (format "Failed to complete %s %s" command-name (.getExecutionEvents context))]
    (if-let [exception (.getFailedExecutionException context)]
      (warn exception message)


(defn ^:private handle-exception
  [f req]
  (let [^Exception raw-response (try (f) (catch Exception e e))
        resp (if (instance? HystrixBadRequestException raw-response)
               (get-thrown-object (.getCause raw-response))
               raw-response)]
