Add exceptions that collections can raise if objects are not found.

And add support for these in the associated request handlers.
If I'm understanding things, the function name and docstring suggest that this function is only used on synchronous functions, but it looks like we also handle cases where the function is async. Happy with this staying as is, but thought I should mention it.