Global -> Logger Handlers

TARDIS errors

tardis_em.utils.errors.standard_error_id(id_s: str)

Fetches the standard error message corresponding to the provided ID.

This function attempts to look up an error ID in a predefined dictionary and returns the associated error message. If the ID does not exist in the dictionary, it falls back to a default string indicating an unknown error.

Parameters:

id_s (str) – The identifier string for the error to search in the dictionary.

Returns:

Corresponding error message if the ID is found, else “UNKNOWN_ERROR”.

Return type:

str

exception tardis_em.utils.errors.TardisError(id_='0', py='NA', desc='Unknown exertion occurred!', warning_b=True)

Handles errors specific to the TARDIS framework and provides mechanisms for standardized error logging, message formatting, and interactive displays.

The class allows the creation of custom error messages with standardized identifiers, logs error-related information to a file, and supports formatted, error-specific console notifications. It also facilitates the truncation of long error descriptions to fit within terminal display constraints.

cut_desc(desc: str) Tuple[str, str, str, str, str, str, str, str]

Splits the given string desc into multiple smaller strings, ensuring each split string does not exceed the defined width. The method first retrieves the available width for truncation and then decides whether the input string needs splitting. If the string is shorter than or equal to the width, no splitting is done; otherwise, the string is truncated into multiple parts using the _truncate_str method.

Parameters:

desc (str) – The input string to be truncated and split into smaller parts.

Returns:

A tuple containing up to eight parts of the truncated string. Parts that are not used remain as empty strings.

Return type:

Tuple[str, str, str, str, str, str, str, str]