def catch_exceptions()

in composer_local_dev/errors.py [0:0]


def catch_exceptions(func=None):
    """
    Catch exceptions and print user friendly message for common issues.
    """
    if not func:
        return functools.partial(catch_exceptions)

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except (
            click.ClickException,
            click.Abort,
        ):
            raise
        except auth_exception.DefaultCredentialsError as err:
            raise InvalidAuthError(str(err))
        except Exception:
            message = "\nFatal exception occurred. Please report at https://github.com/GoogleCloudPlatform/composer-local-dev/issues"
            raise ComposerCliFatalError(message)

    return wrapper