Add error logging/monitoring to failing queries

I'm trying to get some sort of error logging set up. My initial idea was to:

  • Create a generic JS query that handles errors (input, transform and where to send it)
  • Add that JS query to the onFailure callback of an existing query
  • Process the error, #profit

But I can't seem to access the .data or .error functions of the CALLING query.

I'm not triggering the onFailure callback manually. I'm using the native callback in the query settings.

Anyone set up something similar before? How did you manage that?

Hey @minijohn!

Happy to help here! I believe the only native analytics integrations we have are on the Enterprise plan but you may be able to leverage the variable triggeredById which should return the name of the query that triggered the query. Link to our docs on this here. Do you think this could work for your use case here?

1 Like

Hey @Chris-Thompson, I solved it by doing this in the end