StaticFile.fromURL() does not handle exceptions
See original GitHub issueWhen there is no object at the url
specified, url.openStream
causes StaticFile.fromUrl()
effect to throw FileNotFoundException
instead of returning (the equivalent of) None
: see
https://github.com/http4s/http4s/blob/master/core/src/main/scala/org/http4s/StaticFile.scala#L93
Is there anything I can do at the place of the call to work around this while waiting for the fix? Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
What is a good way to handle exceptions when trying ...
How about this: try: f = open(fname, 'rb') except OSError: print "Could not open/read file:", fname sys.exit() with f: reader = csv.reader(f) for...
Read more >Handle errors in ASP.NET Core
The status code pages middleware does not catch exceptions. To provide a custom error handling page, use the exception handler page.
Read more >Handling Cocoa Errors in Swift
Throw and catch errors that use Cocoa's error types. ... You use Swift's throw statement and do - catch statement to throw and...
Read more >Basic Features: Static File Serving
Note: Be sure to not have a static file with the same name as a file in the pages/ directory, as this will...
Read more >Working with Static Files - ASP.NET Core Documentation
The IIS static file handler is not used because it doesn't get a chance to handle requests before they are handled by the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ashwinbhaskar yes, sure. Right now I have another task to work on, so feel free to pick this one up.
@ashwinbhaskar thanks!!!