how to use the cancel() function in operator ?

I have a invoke_props_dialog with 2 dropdowns in it,
these props are defined in another class

when changing the selected value, it will keep it even if I did not confirm with the OK button.

how can I catch the CANCELLED state of an operator ? I tried cancel() with no success

Did you find a solution to this?

nope… I don’t know how it works. but you can perform a terrible test on an operator you called like :

if bpy.ops.anOperator() == {'CANCELLED'} :
   ...

(I didn’t write that.)
provided the op has something else to return than {‘FINISHED’}

it seems cancel is more a convention for operators, it does not catch {‘CANCELLED’} status as far as I know.
so it’s more like :

def invoke/execute/modal() :
    if something goes wrong :
        return self.cancel(context)

[...]

def cancel(self, context) :

the operator_modal_timer template (but maybe I modified it by mistake) has an error about that ( self.cancel() rather than self.cancel(context) )

btw
def end(self) :
and
def init(self) :
can be useful in operators