Skip to content

Commit

Permalink
More Console Prints for Prod (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trivinyx authored Apr 29, 2024
1 parent 0ba5747 commit ebfe9bf
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions backend/img2mapAPI/utils/projectHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,16 @@ async def saveImageFile(self, projectId: int, file: tempfile, fileType: str) ->
try:
await self._FileStorage.removeFile(project["imageFilePath"])
except Exception as e:
path = project.get("imageFilePath", "no path")
print(f"Failed to remove old file with path: {path} :: Exception: {e}, assuming file does not exist, continuing...")
try:
path = project.get("imageFilePath", "no path")
print(f"Failed to remove old file with path: {path} :: Exception: {e}, assuming file does not exist, continuing...")
except Exception as e2:
print(f"Failed to remove old file with path: no path :: Exception: {e2} & {e}, assuming file does not exist, continuing...")
pass

filePath = await self._FileStorage.saveFile(file, ".png")
try:
filePath = await self._FileStorage.saveFile(file, ".png")
except Exception as e:
raise Exception(f"Failed to save file: {e}")
project["imageFilePath"] = filePath
project = Project.model_construct(None, **project)
await self.updateProject(projectId, project)
Expand Down

0 comments on commit ebfe9bf

Please sign in to comment.