Skip to content

Bug: UnboundLocalError on outputs in Exception Logging #3293

@arobergeTT

Description

@arobergeTT

Error:

UnboundLocalError: local variable 'outputs' referenced before assignment

This happens when an exception is raised before outputs is defined, but it's still referenced in the error log:

eval_logger.error(f"Exception:{repr(e)}, {outputs}, retrying.")

Suggestion:

Either initialize outputs = None before the try, or safely access it with locals().get('outputs', None) in the log line.

Anyone else run into this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions