   ([handler]
    (wrap-restful-format handler [:json-kw :edn]))
   ([handler formats]
-   (let [req-handler (format-params/wrap-restful-params handler :formats formats)
-         req-handler' (fn [request]
-                        (safe-go request
-                                 (-> request req-handler <!)))]
+   (let [req-handler (format-params/wrap-restful-params handler :formats formats)]
      (fn [request]
-       (safe-go request
-                (if-let [response (-> request req-handler' <!)]
-                  (->
-                    ;; "Fake" handler. This is an ugly bit of hack to allow the execution
-                    ;; of the true handlers earlier in the go block, and have the response
-                    ;; (if not nil), already taken from the channel.
-                    (constantly response)
-                    (format-response/wrap-restful-response :formats formats)
-                    ;; And now we can invoke our "just brewed up" handler (wrapped around our
-                    ;; standin for the already executed handler).
-                    (as-> f (f request)))
-                  false))))))
+       (let [response-ch (chan 1)]
+         ;; To keep thing fully asynchronous, we first invoke the downstream handler.
+         (take! (try
+                   (req-handler request)
+                   (catch Throwable t
+                     (result->channel
+                       (utils/response HttpServletResponse/SC_INTERNAL_SERVER_ERROR
+                                       {:exception (exceptions/to-message t)}))))
+                (fn [handler-response]
+                  (put! response-ch
+                        (->
+                          ;; We can't pass the asynchronous req-handler to w-r-r, it expects
+                          ;; a sync handler. Instead, we provide a "fake" sync handler
+                          ;; that returns the previously obtained handler response.
+                          (constantly handler-response)
+                          (format-response/wrap-restful-response :formats formats)
+                          ;; Capture and invoke the wrapped, fake handler
+                          (as-> f (f request))))))
+         response-ch)))))
 
 (defn wrap-with-standard-middleware
   "Default asynchronous middleware."

  The function may return false to allow the search for a handler to continue.

  Asynchronous handler functions should be careful to return a 500 response if there is
  a failure (e.g., a thrown exception).  For synchronous functions, a try block is provided
  to generate the 500 response if an exception is thrown.

  For a synchronous handler (which must have the :sync meta-data), the function
  is invoked in a thread, and its result wrapped in a channel (with nil converted to false).

  If no resource handler function has been identified, this function
  will return false (wrapped in a channel)."

   (let [options' (session/session-options options)]
     (fn [request]
       (safe-go request
                (let [request' (session/session-request request options')]
                  (->
                    (handler request')
                    <!
                    (session/session-response request' options'))))))))