mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
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:
@ -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-*")
|
||||
|
Reference in New Issue
Block a user