                         (catch Exception e
                           (histograms/update! (metrics/service-histogram service-id "response-size") bytes-streamed)
                           ; Handle lower down
-                          (throw (Exception.
-                                   (str "error occurred after streaming" bytes-streamed "bytes in response.") e))))]
+                          (throw (ex-info (str "error occurred after streaming " bytes-streamed " bytes in response") {} e))))]
                   (let [bytes-reported-to-statsd'
                         (let [unreported-bytes (- bytes-streamed' bytes-reported-to-statsd)]
                           (if (or (and (not more-bytes-possibly-available?) (pos? unreported-bytes))

            [waiter.util.http-utils :as hu]
            [waiter.util.ring-utils :as ru]
            [waiter.util.utils :as utils])
  (:import (java.io ByteArrayOutputStream InputStream IOException)
           (java.nio ByteBuffer)
           (java.util.concurrent TimeoutException)
           (javax.servlet ServletOutputStream ReadListener ServletInputStream)

                              (log/info "done processing request" status)
                              (when (= :success status)
                                (counters/inc! (metrics/service-counter service-id "request-counts" "successful")))
                              (when (contains? #{:client-error :generic-error :instance-error} status)
                                (counters/inc! (metrics/service-counter service-id "request-counts" (name status))))
                              (when (= :generic-error status)
                                (log/error "there was a generic error in processing the request;"
                                           "if this is a client or server related issue, the code needs to be updated."))
                              (when (not= :success-async status)
                                (counters/dec! (metrics/service-counter service-id "request-counts" "outstanding"))
                                (statsd/gauge-delta! metric-group "request_outstanding" -1))
