Add res conditional and only use host part of registry.

- If an error occurs there will not be a `res` object available. When no res is present default to statusCode of -1.
- Keeping the full path of registry is unnecessary, so just use `host` portion when logging.