mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Move MakeJoin logic to GMSL (#3081)
This commit is contained in:
parent
0489d16f95
commit
67d6876857
80 changed files with 1158 additions and 494 deletions
|
@ -184,8 +184,10 @@ func (r *uploadRequest) doUpload(
|
|||
if err != nil {
|
||||
fileutils.RemoveDir(tmpDir, r.Logger)
|
||||
r.Logger.WithError(err).Error("Error querying the database by hash.")
|
||||
resErr := spec.InternalServerError()
|
||||
return &resErr
|
||||
return &util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: spec.InternalServerError{},
|
||||
}
|
||||
}
|
||||
if existingMetadata != nil {
|
||||
// The file already exists, delete the uploaded temporary file.
|
||||
|
@ -194,8 +196,10 @@ func (r *uploadRequest) doUpload(
|
|||
mediaID, merr := r.generateMediaID(ctx, db)
|
||||
if merr != nil {
|
||||
r.Logger.WithError(merr).Error("Failed to generate media ID for existing file")
|
||||
resErr := spec.InternalServerError()
|
||||
return &resErr
|
||||
return &util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: spec.InternalServerError{},
|
||||
}
|
||||
}
|
||||
|
||||
// Then amend the upload metadata.
|
||||
|
@ -217,8 +221,10 @@ func (r *uploadRequest) doUpload(
|
|||
if err != nil {
|
||||
fileutils.RemoveDir(tmpDir, r.Logger)
|
||||
r.Logger.WithError(err).Error("Failed to generate media ID for new upload")
|
||||
resErr := spec.InternalServerError()
|
||||
return &resErr
|
||||
return &util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: spec.InternalServerError{},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue