Hi there!
I'm having problems understanding how to properly use errorResponseTopic.
Currently I'm running responseTopics without any issue, handling the successful responses flawlessly. But now I also need to handle the errors returning from our server, which would in the console look like this:
My json file looks like the following:
{
"event": "errorClicks",
"url": "our_url_here",
"requestType": "POST",
"headers":{"content-type": "application/json","accept": "application/json"},
"body":"{lots_of_data_here}",
"responseTopic": "hook-response/errorClicks_{{group_belonging}}",
"responseTemplate": "filtered_data_Here",
"errorResponseTopic": "hook-error/errorClicks_{{group_belonging}}",
"mydevices": true,
"noDefaults": true
}
Furthermore, my subscription looks like this:
Particle.subscribe(String("hook-response/errorClicks_" + group_belonging), OKResponseHandler, MY_DEVICES);
Particle.subscribe(String("hook-error/errorClicks_" + group_belonging), errorResponseHandler, MY_DEVICES);
So I can successfully subscribe to the first, getting data fed into the relevant devices, but not the errors! The noticeable difference is whenever I get a successful response, the Particle Console shows
"hook-response/errorClicks_GROUP"
and if unsuccessful
"hook-error/errorClicks/0"
I would have guessed it would instead look like:
"hook-error/errorClicks_GROUP"
Where am I going wrong here?
Thanks!