We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
pwd
1 parent af5156a commit 5876bf4Copy full SHA for 5876bf4
src/structurizr/api/structurizr_client_settings.py
@@ -16,6 +16,7 @@
16
"""Provide the Structurizr client settings."""
17
18
19
+import logging
20
from getpass import getuser
21
from pathlib import Path
22
from socket import getfqdn
@@ -28,7 +29,17 @@
28
29
__all__ = ("StructurizrClientSettings",)
30
31
-USER = getuser()
32
+logger = logging.getLogger(__name__)
33
+
34
35
+try:
36
+ USER = getuser()
37
+except ModuleNotFoundError:
38
+ logger.error(
39
+ "Could not determine the username. Please set it manually or provide a "
40
+ "STRUCTURIZR_USER environment variable."
41
+ )
42
+ USER = "anonymous"
43
hostname = getfqdn()
44
if hostname:
45
USER = f"{USER}@{hostname}"
0 commit comments