use 'as' keyword for getting exception object