Skip to content

Commit

Permalink
🐛 Log warning when file is not found in upstream storage
Browse files Browse the repository at this point in the history
The error handling is updated to log a warning instead of returning a "system busy" status when a file is missing in upstream storage. This change improves visibility into issues with file retrieval without incorrectly signaling system resource issues.
  • Loading branch information
anxuanzi committed Dec 5, 2024
1 parent 27c6488 commit a5f9f44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middlewares/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (m *FileMiddlewares) HandleView() fiber.Handler {
//get file content from storage and display it
fileData, err := m.storage.Get(fmt.Sprintf("%s", fileInfo.UploadedName))
if err != nil {
return webresult.SystemBusy(err)
core.UseGoeContainer().GetLogger().Warn("file not found in upstream storage or error from upstream: ", err)
}
if fileData == nil {
return webresult.NotFound("file not found in upstream storage")
Expand Down

0 comments on commit a5f9f44

Please sign in to comment.