質問

I am using the PetrelLogger.NewAsyncProgress which seems to work well. However I can't figure out how to report an error with my task. Once I Dispose of the NewAsyncProgress, it reports 'Success' for my task.

I have tried setting the ProgressStatus = -1, but that didn't make a difference.

Example:

 using (_asyncProgress = PetrelLogger.NewAsyncProgress("Doing Job", ProgressType.Default, (AsyncProgressCanceledCallback)AsyncProgressCanceled, this))
 {
    try
    {
        //Do Something
        _asyncProgress.ProgressStatus = 100;
    }
    catch (Exception e)
    {
        //Error happened
       _asyncProgress.ProgressStatus = -1;
    }
 }

So if an exception is thrown, the task manager result is Success 100%. Any ideas?

役に立ちましたか?

解決

It's not possible in Ocean at the moment. However, we have such requirement recorded, so it can be implemented in one of future releases

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top