setup: Log full exception traceback when setup fails

- When an error occurs during setup thread execution and the error is not due a
failed privileged action, we are left with very little information about what
went run. On the other than when a privileged action fails, we will be logging
the exception twice. But this is okay.

Tests:

- Increment the setup version of one of installed apps and raise an exception in
setup() method. Notice that exception traceback in the logged message.

- Increment the setup version of one of installed apps and raise an exception in
setup's privileged action. Notice that exception traceback in the logged
message twice.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2025-09-25 15:12:00 -07:00 committed by Veiko Aasa
parent a43082308d
commit 2fbaea191f
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -350,7 +350,7 @@ def run_setup_on_apps(app_ids, allow_install=True):
else:
setup_apps(app_ids, allow_install=allow_install)
except Exception as exception:
logger.error('Error running setup - %s', exception)
logger.exception('Error running setup - %s', exception)
raise