You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exceptFileNotFoundError:
raiseRuntimeError(f"File at path {self.path} does not exist.")
I feel this is catching one exception just to raise a less meaningful one. For my unit tests, I would prefer to expect the FileNotFoundError is raised.
The text was updated successfully, but these errors were encountered:
Raising a RuntimeError in case of a FileNotFoundError is meaningless.
FileResponse should either leave file-related exceptions as they are, allowing them to be caught by ExceptionMiddleware, or raise custom exception classes.
Please reopen the issue.
Found this in FileResponse:
I feel this is catching one exception just to raise a less meaningful one. For my unit tests, I would prefer to expect the FileNotFoundError is raised.
The text was updated successfully, but these errors were encountered: