Skip to content

Commit 10b8a7c

Browse files
committed
Handle
1 parent f1b7629 commit 10b8a7c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

openhexa/cli/api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,12 @@ def execute(self, query, **kwargs):
768768
variables = kwargs.get("variables", {})
769769
click.echo(f"Variables: {variables}")
770770

771-
response = super().execute(query=query, **kwargs)
771+
try:
772+
response = super().execute(query=query, **kwargs)
773+
except Exception as e:
774+
if "authenticated user" in str(e) or "UNAUTHENTICATED" in str(e):
775+
raise InvalidTokenError("No or invalid token found for workspace, the requests are not authenticated.")
776+
raise
772777

773778
if settings.debug:
774779
click.echo("")

0 commit comments

Comments
 (0)