Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
error handling on the workers
onContainerDataSaved = function (container) {
let networkData
try {
networkData = network.fetchNetworkData()
network.attachContainerToNetwork(networkData, container)
websockets.sendErrorToClients("Cannot attach container to the network")
} catch (err) {
if (err instanceof NetworkAttachError) {
messageBus.emit('network.attach.failed', { container, networkData })
// we can set in configuration the retry policy for such worker: exponential back-off, timeout, max number of retries etc,
onNetworkAttachFailed = function (container, networkData) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.