Skip to content

Commit

Permalink
feat: helpful error on poorly formatted headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hatchet-temporary committed Nov 26, 2024
1 parent c731fe1 commit 74ae1b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hatchet_sdk/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,13 @@ def get_config_value(key, env_var):
)

if _oltp_headers:
otel_header_key, api_key = _oltp_headers.split("=", maxsplit=1)
otel_exporter_oltp_headers = {otel_header_key: api_key}
try:
otel_header_key, api_key = _oltp_headers.split("=", maxsplit=1)
otel_exporter_oltp_headers = {otel_header_key: api_key}
except ValueError:
raise ValueError(
"HATCHET_CLIENT_OTEL_EXPORTER_OTLP_HEADERS must be in the format `key=value`"
)
else:
otel_exporter_oltp_headers = None

Expand Down

0 comments on commit 74ae1b1

Please sign in to comment.