[RJA-1661] [fix] - JS: Polling stops if REST request fails

Poller option to reschedule on error added.
Merge pull request #808 from rsvato/agents

[RJA-1661] [fix] - JS: Polling stops if REST request fails