webgme / bindings

WebGME API bindings for Python
MIT License
1 stars 4 forks source link

plugin set result giving errors #14

Open yogeshVU opened 4 years ago

yogeshVU commented 4 years ago

Following two functions give errors when invoked during the debug mode using run_debug.py.

          self.result_set_success(False)

          self.result_set_error('This should fail')

Error is:

error: 2020-09-07T13:11:23.165Z - error: [gme:bin:coremq_server:CoreZMQ] res { err: { message: 'Cannot read property \'setSuccess\' of undefined', type: 'TypeError', stack: 'TypeError: Cannot read property \'setSuccess\' of undefined\n req: { name: 'resultSetSuccess', args: [Array], type: 'plugin' } }, res: null }

Steps to recreate: Create a new python plugin and add the following lines at the end: eg:

class MyPythonPlugin(PluginBase):
    def main(self):
        core = self.core
        root_node = self.root_node
        active_node = self.active_node
        name = core.get_attribute(active_node, 'name')
        logger.info('ActiveNode at "{0}" has name {1}'.format(core.get_path(active_node), name))
        self.result_set_success(False)
        self.result_set_error('This should fail')