<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_error_messages(self):
 """ Method returning error messages. Should return list of messages. By default it find element with class ``error`` and theirs value in attribute ``error`` or text if that attribute is missing. You can change this method accordingly to your app. Error messages returned from this method are used in decorators :py:func:`.expected_error_messages` and :py:func:`.allowed_error_messages`. """

        try:
            error_elms = self.get_elms(class_name='error')
        except NoSuchElementException:
            return []
        else:
            try:
                error_values = [error_elm.get_attribute('error') for error_elm in error_elms]
            except Exception:
                error_values = [error_elm.text for error_elm in error_elms]
            finally:
                return error_values