print_instance_connection_error¶
- pyrcs.utils.print_instance_connection_error(update=False, verbose=False, e=None, raise_error=False)[source]¶
Prints an error message when an instance fails to establish an Internet connection.
- Parameters:
update (bool) – Indicates whether the error occurred during a data update; defaults to
False.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False.e (Exception | None) – An optional exception message to display.
raise_error (bool) – Whether to raise the exception; if
raise_error=False(default), the error will be suppressed.
Examples:
>>> from pyrcs.utils import print_instance_connection_error >>> print_instance_connection_error(verbose=True) The Internet connection is not available. >>> print_instance_connection_error(update=True, verbose=True) The Internet connection is not available. Failed to update the data. >>> print_instance_connection_error(update=True, verbose=2, raise_error=True) Failed. The Internet connection is not available. Failed to update the data. Traceback (most recent call last): ... ... TypeError: exceptions must derive from BaseException