Hello,
I’m currently developing a node application to automate a workflow in ASANA through the API. I’m getting close to my goal but lately I have been bothered by some unexpected “server error” while using client.event.stream.
var streamPRESSE = client.events.stream(“1114493480415867”, {
periodSeconds: 1,
continueOnError: true
});
I have 5 concurrent streams for 5 different projects and they are launched as soon as the app is launched and I listen to their respective 'data" event. But sometimes (I say sometimes but it is very inconsistent) I get this error for for one of the streams :
Unhandled rejection Error: Server Error at ServerError.AsanaError (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/asana/lib/errors/error.js:4:11) at new ServerError (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/asana/lib/errors/server_error.js:5:14) at Request._callback (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/asana/lib/dispatcher.js:161:23) at Request.self.callback (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/request/request.js:1161:10) at Request.emit (events.js:182:13) at IncomingMessage.<anonymous> (/Users/bruere.jb/Desktop/AutoSANA/AUTOSANA/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:273:13) at IncomingMessage.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1094:12) at process._tickCallback (internal/process/next_tick.js:63:19)
I understand that there was a problem on Asana’s side, but the problem is that it kills the stream. I though the option “continueOnError” was meant to prevent this so I use it on every stream, but it doesn’t. Also I didn’t find any explanations about this option in the documentation so I’m actually not sure I really understand its purpose.
Is there a sure way to ensure that the streams continue running even after a server error, or at least to restart them as soon as they crash ?