Bird
0
0

You want to check if a task failed and get its exception message. Which property or method of AsyncResult helps you do this?

hard📝 Application Q8 of 15
Django - Celery and Background Tasks
You want to check if a task failed and get its exception message. Which property or method of AsyncResult helps you do this?
Aresult.traceback
Bresult.exception
Cresult.status
Dresult.ready()
Step-by-Step Solution
Solution:
  1. Step 1: Identify how to get exception info

    The exception property holds the exception raised by the task if it failed.
  2. Step 2: Differentiate from other properties

    While traceback shows the error trace, exception gives the actual error object/message.
  3. Final Answer:

    result.exception -> Option B
  4. Quick Check:

    Use exception property to get task error [OK]
Quick Trick: Use exception property to get task error [OK]
Common Mistakes:
MISTAKES
  • Using traceback instead of exception for error message
  • Checking status only without exception
  • Calling ready() which returns boolean

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes