question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StaticFile.fromURL() does not handle exceptions

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
satorgcommented, Jul 9, 2020

@ashwinbhaskar yes, sure. Right now I have another task to work on, so feel free to pick this one up.

0reactions
dubinskycommented, Jul 17, 2020

@ashwinbhaskar thanks!!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found