Refactoring for error dialogs

Closes-Bug:#1297158

Change-Id: Ib3c457e06357d8b2d1b165fdc12eb85c27785a0e
Merge "Refactoring for error dialogs"