As mention in the developersite, CoroutineWorker handle worker stop automatically but i want to get notified when my CoroutineWorker stopped either due to network turn off after Worker enter to do job or due to unhandled crash inside worker.
WorkManager lib version: 2.0.1
Below is log of Worker being Cancelled when device wifi network turn off.
I/WM-WorkerWrapper: Work [ id=0c1a2916-d973-4553-adb9-cd7dd6ee9338, tags={ 1DY8EEW0HMH5W7S3, com.xyz.abc.CloudWorker } ] was cancelled
java.util.concurrent.CancellationException: Task was cancelled.
at androidx.work.impl.utils.futures.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:1184)
at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:514)
at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:475)
at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:290)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)