@classmethod
def get_error_code_msg(cls, full_error_message):
    """
        Extract the code and message of the exception that clickhouse-server generated.

        See the list of error codes here:
        https://github.com/yandex/ClickHouse/blob/master/dbms/src/Common/ErrorCodes.cpp
        """
    for pattern in cls.ERROR_PATTERNS:
        match = pattern.match(full_error_message)
        if match:
            return int(match.group('code')), match.group('msg').strip()
    return 0, full_error_message
