| 469 | } |
| 470 | |
| 471 | inline |
| 472 | bool TaskQueue::handleError(const WorkItem& workItem) |
| 473 | { |
| 474 | ITaskContinuation::Ptr nextTask; |
| 475 | //Check if we have a final task to run |
| 476 | nextTask = workItem._task->getErrorHandlerOrFinalTask(); |
| 477 | //queue next task and de-queue current one |
| 478 | enqueue(nextTask); |
| 479 | doDequeue(_isIdle, workItem._iter); |
| 480 | //Coroutine ended with explicit user error |
| 481 | _stats.incErrorCount(); |
| 482 | #ifdef __QUANTUM_PRINT_DEBUG |
| 483 | std::lock_guard<std::mutex> guard(Util::LogMutex()); |
| 484 | if (rc == (int)ITask::RetCode::Exception) |
| 485 | { |
| 486 | std::cerr << "Coroutine exited with user exception." << std::endl; |
| 487 | } |
| 488 | else |
| 489 | { |
| 490 | std::cerr << "Coroutine exited with error : " << rc << std::endl; |
| 491 | } |
| 492 | #endif |
| 493 | return false; |
| 494 | } |
| 495 | |
| 496 | inline |
| 497 | bool TaskQueue::handleException(const WorkItem& workItem, const std::exception* ex) |
nothing calls this directly
no test coverage detected