0
let a = null;
try {
    a =  yield context.df.callActivityWithRetry("Some1Activity", retryOptions, obj);
}
catch(error){
    context.log(JSON.stringify(error));
    yield context.df.callActivityWithRetry("Some2Activity", retryOptions, obj2);
    throw new Error(error);
}

My problem is when error occurs, Some2Activity does not get executed. Though it is mentioned in the doc.

I even tried this

let a = null;
let errorObj = null;
try {
    a =  yield context.df.callActivityWithRetry("Some1Activity", retryOptions, obj);
}
catch(error){
    context.log(JSON.stringify(error));
    errorObj = error;
}

if(errorObj !== null) {
    yield context.df.callActivityWithRetry("Some2Activity", retryOptions, obj2);
    throw new Error(error);
}

It did not work. what am i doing wrong here?

Nafis Islam
  • 1,483
  • 1
  • 14
  • 34

1 Answers1

1

I was using durable-functions: ^1.1.0. It has a bug. After upgrading to durable-functions: ^1.1.1 it got fixed.

Nafis Islam
  • 1,483
  • 1
  • 14
  • 34