Skip to content

Importruns: include backtrace into exception handling logging #262

@okt-alexanku

Description

@okt-alexanku

importruns command logs catched exceptions as str(e)

        except Exception as e:
            create_event(
                facility=EventLog.FacilityChoices.IMPORTRUNS,
                severity=EventLog.SeverityChoices.ERR,
                msg=f'failed import {run_url} '
                f'-- {task_msg} '
                f'-- Error: {e!s} '
                f'-- runtime: {runtime(import_run_start_time)} sec',
            )
            logger.error(str(e))

Such error reporting is not so informative since exception backtrace is not shown.
Please use logger.exception() instead of logger.error() to log backtrace also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions