Skip to main content

ErrorTracker

Track errors and aggregates their counts by similarity.

Index

Methods

__init__

  • __init__(*, snapshot_kvs_name, show_error_name, show_file_and_line_number, show_error_message, show_full_message, save_error_snapshots): None
  • Parameters

    • optionalkeyword-onlysnapshot_kvs_name: str | None = None
    • optionalkeyword-onlyshow_error_name: bool = True
    • optionalkeyword-onlyshow_file_and_line_number: bool = True
    • optionalkeyword-onlyshow_error_message: bool = True
    • optionalkeyword-onlyshow_full_message: bool = False
    • optionalkeyword-onlysave_error_snapshots: bool = False

    Returns None

add

  • async add(error, *, context, early): None
  • Add an error in the statistics.


    Parameters

    • error: Exception

      Error to be added to statistics.

    • optionalkeyword-onlycontext: BasicCrawlingContext | None = None

      Context used to collect error snapshot.

    • optionalkeyword-onlyearly: bool = False

      Flag indicating that the error is added earlier than usual to have access to resources that will be closed before normal error collection. This prevents double reporting during normal error collection.

    Returns None

get_most_common_errors

  • get_most_common_errors(n): list[tuple[str | None, int]]
  • Return n most common errors.


    Parameters

    • optionaln: int = 3

    Returns list[tuple[str | None, int]]

Properties

total

total: int

Total number of errors.

unique_error_count

unique_error_count: int

Number of distinct kinds of errors.