                             (.append "Content-Type" (.-type file))
                             (.append "file" file file-name))
                     :on-complete (fn [e] (on-complete file-url))
-                    :on-error (fn [e] (.error js/console "Error uploading: " (pr-str (:error e))))})))}))
+                    :on-error (fn [e] (errorf "Error uploading: %s" (:error e)))})))}))

  (:require [cljs-uuid-utils.core :as uuid]
            [clojure.string :refer [split]]
            [goog.events :as events]
            [chat.client.xhr :refer [edn-xhr ajax-xhr]]
            [chat.client.views.helpers :refer [ends-with?]])
  (:import [goog.net XhrIo EventType]))

    {:method :get
     :uri "/s3-policy"
     :on-error (fn [err]
                 (errorf "Error getting s3 authorization: %s" (:error err)))
     :on-complete
     (fn [{:keys [bucket auth]}]
       (let [file-name (.-name file)
