       (when progress-element
         (set! (-> progress-element .-style .-display) ""))
 
+
       (events/listen req goog.net.EventType.ERROR
                      (fn [e]
-                       (print "REQUEST ERROR: ")
-                       (let [ee (.-target e)
-                             rt (.getResponseText ee)]
+                       (print "REQUEST ERROR")
+                       (let [ee (.-target e)]
                          (try
-                           (let [response (t/read r rt)]
+                           (make-reload-if-reload-client (t/read r (.getResponseText ee)))
+                           (catch js/Error e
+                             (println "ERR -1 " e)))
+                         (print-error "ERROR" ee false)
+                         (if error-fn (error-fn e)))))
+
+      (events/listen req goog.net.EventType.SUCCESS
+                     (fn [e]
+                       (println "REQUEST SUCCESS")
+                       (let [ee (.-target e)]
+                         ;;(redirect-to-root-when-not-transit ee)
+                         (try
+                           (let [r (t/read r (.getResponseText ee))]
                              (make-reload-if-reload-client r)
-                             (print-error "ERROR: " ee false)
-                             ;;(js/alert (str "ОШИБКА ОБРАЩЕНИЯ К СЕРВЕРУ:\n" response))
-                             (if error-fn (error-fn response)))                           
-                           (catch js/Error e
-                             (let [m (str "ERROR: " e)]                               
-                               (print-error "ERRON IN ERROR:" ee true)
-                               (js/alert (str  "ERRON IN ERROR: " rt))))))))
+                             (success-fn r))
+                           (catch js/Error e                             
+                             (println (str "ERR 1 " e))
+                             (print-error "ERRON IN REQUEST SUCCESS" ee false))))))
 
       (events/listen req goog.net.EventType.COMPLETE
                      (fn [e]

          (make-reload-if-reload-client [r]
            (when (get r :reload-client)
              (do (js/alert "СЕРВЕР ПРИСЛАЛ СИГНАЛ НА ОБНОВЛЕНИЕ")
                (set! (.-location js/window) "/"))))]
    
    (let [req (goog.net.XhrIo.)
          progress-element (if disable-progress-element?
                             false

                           (set! (-> progress-element .-style .-display) "none"))

                         (println "REQUEST COMPLETE")
                         (if complete-fn (complete-fn e)))))




      (.send req
             uri
             "POST"
