Fix 404 response when pulling unknown image while the DB is down

Problem

While working on #251 (closed), I noticed that if we:

  1. Start registry with metadata DB enabled;
  2. Stop DB server;
  3. docker pull <addr>/unknown:latest

The response is a 404 Not Found with the message manifest unknown. This means that the DB is not the first one to be checked for the existence of a tag/manifest. The same may apply to blobs.

Expected Behaviour

Response with an internal server error because the DB is down.

Edited by João Pereira