Skip to content

Commit cf699bb

Browse files
committed
from_env: friendlier error on missing api key
1 parent 6ff14b9 commit cf699bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flareio/api_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def __init__(
3636
def from_env(cls) -> "FlareApiClient":
3737
api_key: t.Optional[str] = os.environ.get("FLARE_API_KEY")
3838
if not api_key:
39-
raise Exception("Please set the FLARE_API_KEY environment variable")
39+
raise Exception(
40+
"Please set the FLARE_API_KEY environment variable. Otherwise, initiate the client using FlareApiClient(api_key=...)."
41+
)
4042
tenant_id: t.Optional[str] = os.environ.get("FLARE_TENANT_ID")
4143
return cls(
4244
api_key=api_key,

0 commit comments

Comments
 (0)