Skip to content

Commit f79767e

Browse files
committed
Move StatusCode import to top of file
1 parent d9dcc85 commit f79767e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/mcp/server/lowlevel/server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ async def main():
4545
from typing import Any, Generic, cast
4646

4747
import anyio
48+
from opentelemetry.trace import StatusCode
4849
from starlette.applications import Starlette
4950
from starlette.middleware import Middleware
5051
from starlette.middleware.authentication import AuthenticationMiddleware
@@ -516,8 +517,6 @@ async def _handle_request(
516517
response = types.ErrorData(code=types.METHOD_NOT_FOUND, message="Method not found")
517518

518519
if isinstance(response, types.ErrorData) and span is not None:
519-
from opentelemetry.trace import StatusCode
520-
521520
span.set_status(StatusCode.ERROR, response.message)
522521

523522
try:

0 commit comments

Comments
 (0)