src/callbacks.c
/* Returns true if an error has been added... */
Returns true if an error has been added
Returns true if an error has been added
static int maybe_push_operr(pycbc_MultiResult *mres,
                            pycbc_Result *res,
                            lcb_STATUS err,
                            int check_enoent,
                            pycbc_debug_info debug_info)
{
    pycbc_stack_context_handle parent_context =
            res ? (res->tracing_context ? res->tracing_context->parent : NULL)
                : NULL;
    PYCBC_DEBUG_LOG_CONTEXT(parent_context, "maybe_push_operr")
    if (err == LCB_SUCCESS || mres->errop) {
        return 0;
    }
    if (parent_context) {
        PYCBC_DEBUG_LOG_CONTEXT(parent_context, "maybe_push_operr")
        pycbc_Result_propagate_context(
                res, res->tracing_context, mres ? mres->parent : NULL);
    }
    if (check_enoent && (mres->mropts & PYCBC_MRES_F_QUIET) &&
        (err == LCB_ERR_DOCUMENT_NOT_FOUND ||
         err == LCB_ERR_SUBDOC_PATH_NOT_FOUND)) {
        return 0;
    }
    mres->errop = (PyObject *)res;
    if (pycbc_debug_info_is_valid(&debug_info)) {
        PyObject *py_debug_info = NULL;
        if (!res->tracing_output) {
            res->tracing_output = PyDict_New();
        }
        {
            py_debug_info = PyDict_GetItemString(res->tracing_output,
                                                 PYCBC_DEBUG_INFO_STR);
            if (!py_debug_info) {
                py_debug_info = PyDict_New();
                PyDict_SetItemString(res->tracing_output,
                                     PYCBC_DEBUG_INFO_STR,
                                     py_debug_info);
            }
            pycbc_dict_add_text_kv(py_debug_info, "FILE", debug_info.FILE);
            pycbc_dict_add_text_kv(py_debug_info, "FUNC", debug_info.FUNC);
            pycbc_set_kv_ull_str(
                    py_debug_info, "LINE", (lcb_uint64_t)debug_info.LINE);
            PYCBC_DECREF(py_debug_info);
        };
    }
    Py_INCREF(mres->errop);
    return 1;
}
static int maybe_push_operr ( pycbc_MultiResult * mres , pycbc_Result * res , lcb_STATUS err , int check_enoent , pycbc_debug_info debug_info ) { pycbc_stack_context_handle parent_context = res ? ( res -> tracing_context ? res -> tracing_context -> parent : NULL ) : NULL ; PYCBC_DEBUG_LOG_CONTEXT ( parent_context , " " ) if ( err == LCB_SUCCESS || mres -> errop ) { return 0 ; } if ( parent_context ) { PYCBC_DEBUG_LOG_CONTEXT ( parent_context , " " ) pycbc_Result_propagate_context ( res , res -> tracing_context , mres ? mres -> parent : NULL ) ; } if ( check_enoent && ( mres -> mropts & PYCBC_MRES_F_QUIET ) && ( err == LCB_ERR_DOCUMENT_NOT_FOUND || err == LCB_ERR_SUBDOC_PATH_NOT_FOUND ) ) { return 0 ; } mres -> errop = ( PyObject * ) res ; if ( pycbc_debug_info_is_valid ( & debug_info ) ) { PyObject * py_debug_info = NULL ; if ( ! res -> tracing_output ) { res -> tracing_output = PyDict_New ( ) ; } { py_debug_info = PyDict_GetItemString ( res -> tracing_output , PYCBC_DEBUG_INFO_STR ) ; if ( ! py_debug_info ) { py_debug_info = PyDict_New ( ) ; PyDict_SetItemString ( res -> tracing_output , PYCBC_DEBUG_INFO_STR , py_debug_info ) ; } pycbc_dict_add_text_kv ( py_debug_info , " " , debug_info . FILE ) ; pycbc_dict_add_text_kv ( py_debug_info , " " , debug_info . FUNC ) ; pycbc_set_kv_ull_str ( py_debug_info , " " , ( lcb_uint64_t ) debug_info . LINE ) ; PYCBC_DECREF ( py_debug_info ) ; } ; } Py_INCREF ( mres -> errop ) ; return 1 ; }
Returns true if an error has been added...
Returns true if an error has been added ...