google-calendar: Exit on fatal errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
8fc924cd12
commit
3855740b63
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,7 @@ try:
|
|||
from googleapiclient import discovery
|
||||
except ImportError:
|
||||
logging.exception("Install google-api-python-client")
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
|
||||
import zulip
|
||||
|
@ -106,8 +107,10 @@ def get_credentials() -> client.Credentials:
|
|||
return credentials
|
||||
except client.Error:
|
||||
logging.exception("Error while trying to open the `google-credentials.json` file.")
|
||||
sys.exit(1)
|
||||
except OSError:
|
||||
logging.error("Run the get-google-credentials script from this directory first.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def populate_events() -> Optional[None]:
|
||||
|
|
Loading…
Add table
Reference in a new issue