@@ -328,26 +328,33 @@ exception, in fact ``result.get()`` will propagate any errors by default:
328
328
329
329
.. code-block :: pycon
330
330
331
- >>> res = add.delay(2)
331
+ >>> res = add.delay(2, '2' )
332
332
>>> res.get(timeout=1)
333
333
334
334
.. code-block :: pytb
335
335
336
336
Traceback (most recent call last):
337
- File "<stdin>", line 1, in <module>
338
- File "/opt/devel/celery/celery/result.py", line 113, in get
339
- interval=interval)
340
- File "/opt/devel/celery/celery/backends/rpc.py", line 138, in wait_for
341
- raise meta['result']
342
- TypeError: add() takes exactly 2 arguments (1 given)
343
-
344
- If you don't wish for the errors to propagate then you can disable that
345
- by passing the ``propagate `` argument:
337
+ File "<stdin>", line 1, in <module>
338
+ File "celery/result.py", line 221, in get
339
+ return self.backend.wait_for_pending(
340
+ File "celery/backends/asynchronous.py", line 195, in wait_for_pending
341
+ return result.maybe_throw(callback=callback, propagate=propagate)
342
+ File "celery/result.py", line 333, in maybe_throw
343
+ self.throw(value, self._to_remote_traceback(tb))
344
+ File "celery/result.py", line 326, in throw
345
+ self.on_ready.throw(*args, **kwargs)
346
+ File "vine/promises.py", line 244, in throw
347
+ reraise(type(exc), exc, tb)
348
+ File "vine/five.py", line 195, in reraise
349
+ raise value
350
+ TypeError: unsupported operand type(s) for +: 'int' and 'str'
351
+
352
+ If you don't wish for the errors to propagate then you can disable that by passing the ``propagate `` argument:
346
353
347
354
.. code-block :: pycon
348
355
349
356
>>> res.get(propagate=False)
350
- TypeError('add() takes exactly 2 arguments (1 given)', )
357
+ TypeError("unsupported operand type(s) for +: 'int' and 'str'" )
351
358
352
359
In this case it'll return the exception instance raised instead,
353
360
and so to check whether the task succeeded or failed you'll have to
0 commit comments