the Success and Failure Event Handlers are very useful, but there isn't an Error one to simulate catch(err) from try/catch. If you try to run the proxy/dummy query created when you add an Input Query for a module, it will display an error saying "no query provided for <query_name_here>" but the Failure Event Handler isn't triggered (obv the Success one isn't triggered either) so the only way to handle errors seems to be to move the query to a JS Query and code it out, but that's a lot of work just for error handling.
i guess the other solution would be to move the query to a workflow to take advantage of Global Error Handlers, but that adds overhead that could hinder users (make them wait too often and ppl get annoyed or think something broke.... in the worst case they start button mashing queuing up a bunch of queries that end up having to run since you can't cancel a running query. maybe you can w JS if u create a promise w a cancelation token?)
onFailure handler doesn't seem to catch the error at all. the error seems to occur before the query is actually ran so the query doesn't know it failed. seems like something behind the scene is trying to call the query and it's failing
That is interesting... do you have a minimal example app you could export? I am just now learning / trying to use passed module queries so I am not entirely sure how it all behaves.
i do get what the error means. the module doesn't actually know what query will be passed in so it has nothing to run. since there is nowhere to define test data or temporarly assign a local query to act as the passed in query it tries to run a null query.... like make input1_test query, and make that the query that is called when you run input1 so we can mock the flow of things, idk
Moreover, this test-input query doesn't seem to be called at all when the dummy query that it's a stand-in for gets calledβit never shows as having run in the debug console, nor does the console.log execute.
The module input query itself β i.e. the dummy query Retool automatically creates for the module input β does run:
( Though I guess that's no surprise given the error, which basically states that it has nothing to run, even though I provide it with that test input query.)
Providing a query (as a true input) to the module from a parent app, and then calling that as, say, a success event handler works great! But it's unfortunate that the test input seems to be fully ignored, and that nothing else can seem to prevent the reference error when trying to use the same functionality within the module itself.
Note this doesn't break anything for us, it's just confusing and feels glitchy.