whitenoise icon indicating copy to clipboard operation
whitenoise copied to clipboard

Handle FileNotFoundError and emit warning on broken symlink in scantree()

Open fdemmer opened this issue 1 year ago • 4 comments

Fixes #605.

fdemmer avatar Aug 26 '24 18:08 fdemmer

Excellent work pre-commit! That is a indeed broken symlink... on purpose :)

fdemmer avatar Aug 26 '24 18:08 fdemmer

Why would we turn this into a warning when it's a clear sign of something being misconfigured?

adamchainz avatar Aug 26 '24 21:08 adamchainz

Wasn't sure about that either; silent exception handling would be just fine.

fdemmer avatar Aug 26 '24 21:08 fdemmer

What I mean was, why do anything at all? A crash seems like a good thing. Broken symlinks seem like something that the user should track down and fix. Perhaps some static assets have gone missing.

I get that your server crashed but I don't think blindly ignoring the error is a good thing to do.

adamchainz avatar Aug 27 '24 15:08 adamchainz

Closing per the above. I'm not convinced Whitenoise should handle this edge case.

adamchainz avatar Oct 28 '24 11:10 adamchainz