Fix noisy errors (#49)

* send message error.

* read message error.

* close webrtc conn only if not closed yet.

* file upload no files received.
This commit is contained in:
Miroslav Šedivý
2023-05-19 17:19:38 +02:00
committed by GitHub
parent 3e8d686c0f
commit dfc7eb3882
4 changed files with 26 additions and 12 deletions

View File

@ -95,15 +95,13 @@ func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) e
//nolint
defer r.MultipartForm.RemoveAll()
if !h.desktop.IsFileChooserDialogOpened() {
return utils.HttpUnprocessableEntity("file chooser dialog is not open")
}
req_files := r.MultipartForm.File["files"]
if len(req_files) == 0 {
return utils.HttpInternalServerError().
WithInternalErr(err).
WithInternalMsg("unable to copy uploaded file to destination file")
return utils.HttpBadRequest("no files received")
}
if !h.desktop.IsFileChooserDialogOpened() {
return utils.HttpUnprocessableEntity("file chooser dialog is not open")
}
dir, err := os.MkdirTemp("", "neko-dialog-*")