     (.modal ($ :#iModalProjectMenu) "hide")
     (ajax
      (str "/api/projects/" project-id) "DELETE"
-     {} #(common-update-callback "Project don't deleted!" {} %))))
+     {} (wrap-error-alert 
+         #(common-update-callback "Project don't deleted!" {} %)))))
 
 (defn update-project []
   (let [project-id (:current-project (deref state/app-state))

    (ajax
     (str "/api/projects/" project-id) "PUT"
     {:name new-name} 
     #(common-update-callback "Project don't renamed!" {} %))))



      (ajax "/api/actions/test" "POST" data (fn [e])))))

(defn wrap-error-alert [callback]
  (fn [reply]
    (let [resp (js->clj reply)]
      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
      (callback reply))))


(defn common-update-callback [msg data reply]
  (let [resp (js->clj reply)]
