human
Complete this python program:
def less_shitty_error_messages(func):
assistant
#Here is the Python program you requested.

    """Wraps functions where the first param is a SQL statement and enforces
    any exceptions thrown will also contain the statement in the message.
    """
    @wraps(func)
    def inner(self, sql, *args, **kwargs):
        try:
            return func(self, sql, *args, **kwargs)
        except Exception as e:
            exc_info = sys.exc_info()
            msg = '{}\nSQL:    {}'.format(repr(e), sql)
            six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
    return inner