def nl_cb_err(cb, kind, func, arg):
if kind < <NUM_LIT:0> or kind > NL_CB_KIND_MAX:<EOL><INDENT>return -NLE_RANGE<EOL><DEDENT>if kind == NL_CB_CUSTOM:<EOL><INDENT>cb.cb_err = func<EOL>cb.cb_err_arg = arg<EOL><DEDENT>else:<EOL><INDENT>cb.cb_err = cb_err_def[kind]<EOL>cb.cb_err_arg = arg<EOL><DEDENT>return <NUM_LIT:0><EOL>
Set up an error callback. Updates `cb` in place.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L343

    Positional arguments:
    cb -- nl_cb class instance.
    kind -- kind of callback (integer).
    func -- callback function.
    arg -- argument to be passed to callback function.

    Returns:
    0 on success or a negative error code.