adunkman/connect-assets — pull request #191 by williamcoates (2013-05-29 12:32:28+00:00)
Title: Add new option 'gracefulMissingImages' which doesnt throw error for missing images

In my app I have many images loaded from the database, and I am using the connect-assets img helper to render the correct assets path to the view

Currently, if someone would accidentally remove an image, my whole app would crash if someone visited that page, which doesn't seem very robust:

```
Error: No file found for route foo.jpg
```

I don't want to guard against this by checking that each image actually exists as this will create a whole lot of overhead; much better rather that connect-assets can gracefully handle missing images.

My solution is that if you set gracefulMissingImages to true, connect-assets will simply return path '/__missing-image'. The image will be broken (unless you add a route for that path), but at least the application will not crash.

You could then add a handler for example in express that could notify you of missing images if you wanted... and perhaps render a nice placeholder image.