diff --git a/dcos/http.py b/dcos/http.py index 672c01a..4b960b0 100644 --- a/dcos/http.py +++ b/dcos/http.py @@ -159,7 +159,7 @@ def request(method, if auth_token is not None: msg = ("Your core.dcos_acs_token is invalid. " "Please run: `dcos auth login`") - raise DCOSException(msg) + raise DCOSAuthenticationException(msg) else: raise DCOSAuthenticationException(response) elif response.status_code == 422: diff --git a/dcos/packagemanager.py b/dcos/packagemanager.py index 70a65fa..ac40187 100644 --- a/dcos/packagemanager.py +++ b/dcos/packagemanager.py @@ -67,6 +67,10 @@ class PackageManager: try: response = self.cosmos.call_endpoint( 'capabilities').json() + except DCOSAuthenticationException: + raise + except DCOSAuthorizationException: + raise except Exception as e: logger.exception(e) return False