Skip to content

Commit 48c66d5

Browse files
committed
Fix mypy check by make _load_runtime_context failfast
1 parent 0dbf95a commit 48c66d5

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

opentelemetry-api/src/opentelemetry/context/__init__.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,14 @@ def _load_runtime_context() -> typing.Optional[_RuntimeContext]:
4242
OTEL_PYTHON_CONTEXT, default_context
4343
) # type: str
4444

45-
try:
46-
return next( # type: ignore
47-
iter( # type: ignore
48-
entry_points( # type: ignore
49-
group="opentelemetry_context",
50-
name=configured_context,
51-
)
45+
return next( # type: ignore
46+
iter( # type: ignore
47+
entry_points( # type: ignore
48+
group="opentelemetry_context",
49+
name=configured_context,
5250
)
53-
).load()()
54-
except Exception: # pylint: disable=broad-except
55-
logger.exception(
56-
"Failed to load context: %s", configured_context
5751
)
52+
).load()()
5853

5954
_RUNTIME_CONTEXT = _load_runtime_context()
6055

0 commit comments

Comments
 (0)