def METHOD_NAME(self):
    """Custom error handling.
    When an exception is thrown:
        - Display an optional message
        - Pretty print the traceback
        - Parse unintuitive errors and redisplay
        - Store useful system information in a tarball for debugging
    """
    def _excepthook(
        type_: Type[BaseException],
        value: BaseException,
        traceback: Optional[TracebackType],
    ) -> None:
        click.secho(f"\n{self.message}:\n", fg="red", bold=True)
        _Traceback(type_, value, traceback).pretty_print()
        self.metadata.print()
        if os.environ.get("LATCH_NO_CRASH_REPORT") == "1":
            click.secho(
                "Not generating crash report due to $LATCH_NO_CRASH_REPORT",
                bold=True,
            )
            return
        if not click.confirm("Generate a crash report?"):
            return
        print("Generating...")
        self._write_state_to_tarball()
    sys.excepthook = _excepthook