Handle exception by accessing the widget