responseTemplate for errors?

Hey all!

Using webhooks I’m successfully handling incoming responses from our server using responseTemplate and responseTopic, but trying to figure out how to handle errors through errorResponseTopic. Errors that are handled through errorResponseTopic doesn’t seem to go through the mustasch responseTemplate I’m using, but success responses are. I’ve also confirmed that the errorResponseTopic works, but I’m not able to access any data that the error response contains. Is there’s a errorResponseTemplate or similar that handles those?

Thanks!

Have you tried searching the forum before posting this?
https://community.particle.io/search?q=responsetemplate%20error

Have you? None of them mentions anything remotely close to what I’m asking here, except for my own thread which I do consider to be a separate matter though since it does not concern the responseTemplate, but errorResponseTopic.

Maybe @Dave can chime in here.

1 Like

I'd say this issue is not an isolated or seperate matter from your other thread (where I'd see this question better asked instead of a seperate thread) as the close relationship between responseTopic and responseTemplate is just as close on errorResponseTopic and the (maybe missing or undocumented) errorResponseTemplate and since @jvanier had already mentioned the issue with errorResponseTopic to be considered a bug, this might be cloesely tied to the same too.

So the least to expect might have been a link to the other thread to avoid confusion as the same things as said there would apply here too.
Error responses go a different route than success responses.

BTW, I have read all posts since 2015 but I don't usually look who's posted a thread hence the fact that the other thread was your own has completely slipped my mind.

1 Like

Well your world and mine obviously doesn’t really go together here @ScruffR, since I do believe they are two separate matters. Nonetheless, I do think you’re not really providing any helpful advice with your comments. I know that you provide substance to the forum by your presence but this tone is rather unwelcoming, at least to me, unfortunately.

Back to the topic: I’ll tried adding "errorResponseTemplate":"{{xx}}" as a line in my .json file and added the webhook through the CLI, in desparate hope of it being an undocumented feature. It seems like it wasn’t though :slight_smile:

Hey All,

Sorry about any confusion on our end, Julien is working on fixing a bug in the API that prevented errorResponseTopic from being consumed on the original webhook creation endpoint. If I remember correctly, the new integrations endpoint works fine, so if you use console.particle.io to create the hook in the meantime, that should be a workaround until its fixed.

Thanks!
David

2 Likes

No worries @Dave. Thanks for the update, and yes using your webhook builder is a workaround. Do you have any input on handling the errorResponse though? Since the responseTemplate at present doesn’t seem to trigger/used if a response is handled by the errorResponseTopic, only responseTopic.

Hmm, I believe at the moment there isn’t yet a special property for specifying the template for the error response on its own, it’s rendered the same as the normal body. That seems like a good idea / I’m surprised we don’t have that yet. I’ll pass that along to the team.

Thanks!
David

2 Likes