Domain UI: Fix for searching domains and the move to factory

If may raise an exception could be wrapped in try/except and call self.fail in case of the exception, and failure is always better than an error.