def set_error_handler(codec, handler, data=None):
OPENJP2.opj_set_error_handler.argtypes = [CODEC_TYPE,<EOL>ctypes.c_void_p,<EOL>ctypes.c_void_p]<EOL>OPENJP2.opj_set_error_handler.restype = check_error<EOL>OPENJP2.opj_set_error_handler(codec, handler, data)<EOL>
Wraps openjp2 library function opj_set_error_handler.

    Set the error handler use by openjpeg.

    Parameters
    ----------
    codec : CODEC_TYPE
        Codec initialized by create_compress function.
    handler : python function
        The callback function to be used.
    user_data : anything
        User/client data.

    Raises
    ------
    RuntimeError
        If the OpenJPEG library routine opj_set_error_handler fails.