         :else (error-404-response request))
 
       (= status ::http-api/not-found) (error-404-response request)
-      :else {:status 500})))
+      
+      :else (do (log/info (str "writer-invitation: error retrieving invitation " {:http-api-status status
+                                                                                  :uuid uuid}))
+                (default-error-page request 500)))))
 
 (defn create-profile-get [request]
   {:status 200

  (let [star-data (fr/request->star-info request (get (friend/current-authentication) :identity))
        {status :status stored-star :result} (http-api/post-star star-data)]
    (cond
      (= status ::http-api/success) (redirect-to-params-referer request)

      (= status ::http-api/invalid-input) {:status 400}

      :else {:status 502})))

(defn post-mark [request]
  (if-let [mark-data (fr/request->mark-info request (get (friend/current-authentication) :identity))]
    (let [{status :status mark :result} (http-api/post-mark mark-data)]
      (case status
        ::http-api/success (redirect-to-params-referer request)
        ::http-api/invalid-input {:status 400}

        {:status 502}))
    {:status 400}))

;;ADMINS


                               :writer-email (:writer-email stored-invitation)})))

          ::http-api/invalid-input
          (do (log/info (str "invitation-form-post: invalid input in create-invitation api call " {:data (:data invitation-data)}))
              (default-error-page request 400))

          (do (log/info (str "invitation-form-post: error in create-invitation api call " {:data (:data invitation-data)
                                                                                           :http-api-status status}))
              (default-error-page request 502))))

      ::fr/invalid
      (-> (response/redirect (utils/path-for :fe/invite-writer :id (:id route-params)))
          (assoc :flash {:validation (dissoc invitation-data :status)})))
    
    (do (log/info (str "invitation-form-post: fatal data validation error " {:request {:params request
                                                                                       :route-params request}}))
        (default-error-page request 400))))

(defn writer-invitation [{{uuid :uuid} :route-params :keys [t' locale session] :as request}]
  (let [{status :status invitation :result} (http-api/retrieve-invitation-by-uuid uuid)
