Fix for REGISTRY-2342

REGISTRY-2342: Cannot return custom error messages in mounted setup