fix: add a check for a 500 error

This commit is contained in:
Derrick Hammer 2023-05-17 13:33:22 -04:00
parent 76b6fb34fe
commit df08fc980a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ func Upload(r io.ReadSeeker, size int64) (model.Upload, error) {
return upload, err
}
if objectExistsResult.StatusCode() == 500 {
return upload, errors.New(fmt.Sprintf("error fetching file: %s", objectExistsResult.String()))
}
if objectExistsResult.StatusCode() != 404 {
return upload, errors.New("file already exists in network, but missing in database")
}