## Description

Fix `Task.handle_failure` not wrapping the exception correctly in case of unpicklealbe exceptions.

Other changes:
* add the traceback object too when wrapping an unpickleable exception
* added tests to ensure that `Task.handle_failure` and `Task.handle_retry` work as expected

This work is a continuation of the fixes I made in https://github.com/celery/celery/pull/8133.

<!-- Please describe your pull request.

NOTE: All patches should be made against main, not a maintenance branch like
3.1, 2.5, etc.  That is unless the bug is already fixed in main, but not in
that version series.

If it fixes a bug or resolves a feature request,
be sure to link to that issue via (Fixes #4412) for example.
-->

Fix `Task.handle_ignore` not wrapping exceptions properly. ## Description

Fix `Task.handle_failure` not wrapping the exception correctly in case of unpicklealbe exceptions.

Other changes:
* add the traceback object too when wrapping an unpickleable exception
* added tests to ensure that `Task.handle_failure` and `Task.handle_retry` work as expected

This work is a continuation of the fixes I made in https://github.com/celery/celery/pull/8133.

<!-- Please describe your pull request.

NOTE: All patches should be made against main, not a maintenance branch like
3.1, 2.5, etc.  That is unless the bug is already fixed in main, but not in
that version series.

If it fixes a bug or resolves a feature request,
be sure to link to that issue via (Fixes #4412) for example.
-->

; ================================
;  celery beat supervisor example
; ================================

[program:celerybeat]
; Set full path to celery program if using virtualenv
command=celery -A myapp beat --schedule /var/lib/celery/beat.db --loglevel=INFO

; remove the -A myapp argument if you aren't using an app instance

directory=/path/to/project
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/beat.log
stderr_logfile=/var/log/celery/beat.log
autostart=true
autorestart=true
startsecs=10

; Causes supervisor to send the termination signal (SIGTERM) to the whole process group.
stopasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=999

; ================================
;  celery beat supervisor example
; ================================

[program:celerybeat]
; Set full path to celery program if using virtualenv
command=celery -A myapp beat --schedule /var/lib/celery/beat.db --loglevel=INFO

; remove the -A myapp argument if you aren't using an app instance

directory=/path/to/project
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/beat.log
stderr_logfile=/var/log/celery/beat.log
autostart=true
autorestart=true
startsecs=10

; Causes supervisor to send the termination signal (SIGTERM) to the whole process group.
stopasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=999
