Skip to content

Commit 8ed359a

Browse files
authored
Fix trying to unescape non-escaped strings (#65)
1 parent b3140d2 commit 8ed359a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/jupyterhub_cost_monitoring/query_usage.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ def _process_response(
131131
if component_name == "home storage":
132132
for entry in processed_result:
133133
if "shared" not in entry["user"]:
134-
entry["user"] = escapism.unescape(entry["user"], escape_char="-")
134+
try:
135+
entry["user"] = escapism.unescape(entry["user"], escape_char="-")
136+
except ValueError:
137+
logger.warning(
138+
f"Could not unescape username {entry['user']} for home storage component."
139+
)
140+
continue
135141
return processed_result
136142

137143

0 commit comments

Comments
 (0)