def METHOD_NAME(instance):
    oracle_check = Oracle(CHECK_NAME, {}, [instance])
    cached_connection = mock.Mock()
    oracle_check._cached_connection = cached_connection
    error = oracle_check.handle_query_error('foo')
    assert error == 'foo'
    assert oracle_check._cached_connection is None
    cached_connection.assert_has_calls([mock.call.close()])