Skip to main content

ErrorSnapshotter

Index

Methods

__init__

  • __init__(*, snapshot_kvs_name): None
  • Parameters

    • optionalkeyword-onlysnapshot_kvs_name: str | None = None

    Returns None

capture_snapshot

  • async capture_snapshot(error_message, file_and_line, context): None
  • Capture error snapshot and save it to key value store.

    It saves the error snapshot directly to a key value store. It can't use context.get_key_value_store because it returns KeyValueStoreChangeRecords which is commited to the key value store only if the RequestHandler returned without an exception. ErrorSnapshotter is on the contrary active only when RequestHandler fails with an exception.


    Parameters

    • error_message: str

      Used in filename of the snapshot.

    • file_and_line: str

      Used in filename of the snapshot.

    • context: BasicCrawlingContext

      Context that is used to get the snapshot.

    Returns None

Properties

ALLOWED_CHARACTERS

ALLOWED_CHARACTERS: Undefined

BASE_MESSAGE

BASE_MESSAGE: Undefined

MAX_ERROR_CHARACTERS

MAX_ERROR_CHARACTERS: Undefined

MAX_FILENAME_LENGTH

MAX_FILENAME_LENGTH: Undefined

MAX_HASH_LENGTH

MAX_HASH_LENGTH: Undefined

SNAPSHOT_PREFIX

SNAPSHOT_PREFIX: Undefined