I'm currently working on a query error tracker. So whenever there's an error, the information gets inserted into a table at the retool database. So I'm trying to see what's the best way to move forward by doing some experiments.
Currently the best way I've thought about is to add a function to every query that I want to track so if something fails, it gets triggered. Which looks as follows:
But I have two questions:
1.- Could I self-reference the same query so instead of putting
error: query1.data I would instead write something like
error: this.data so that I can easily copy the script to all of the other queries that I need to track? (I already try with
this but it didn't worked so I'm not so sure if I could self-reference the query that's being used)
2.- Is this a good way to accomplish what I'm trying to do? I've been following other posts in the community which are trying to accomplish the same thing but there are some gaps which I haven't been able to figure out how to do by myself based on the information provided.
I'll continue experimenting, but regarding the first question, that's something I haven't found an answer yet on my own, whether it's on the docs or in the forum. So any help would be greatly appreciated.