Skip to content

Commit c7d70d3

Browse files
jeku46claudePawelPeczek-Roboflow
authored
Catch RoboflowAPITimeoutError and RoboflowAPIConnectionError in pipeline init (#2285)
Previously these exceptions fell through to the generic Exception handler in _handle_command, leaving the pipeline subprocess in an unclear state. Now they surface with explicit error messages and ErrorType.OPERATION_ERROR so operators can distinguish a network/timeout failure from other init errors. Related: ROBOFLOW_API_REQUEST_TIMEOUT default added to roboflow-edge build to prevent indefinite blocking on stale TCP connections after network recovery. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Paweł Pęczek <146137186+PawelPeczek-Roboflow@users.noreply.github.com>
1 parent 901fbf2 commit c7d70d3

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

inference/core/interfaces/stream_manager/manager_app/inference_pipeline_manager.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
from inference.core import logger
2121
from inference.core.exceptions import (
2222
MissingApiKeyError,
23+
RoboflowAPIConnectionError,
2324
RoboflowAPINotAuthorizedError,
2425
RoboflowAPINotNotFoundError,
26+
RoboflowAPITimeoutError,
2527
)
2628
from inference.core.interfaces.camera.entities import VideoFrame
2729
from inference.core.interfaces.camera.exceptions import StreamOperationNotAllowedError
@@ -239,6 +241,22 @@ def _initialise_pipeline(self, request_id: str, payload: dict) -> None:
239241
"wrong API key used.",
240242
error_type=ErrorType.NOT_FOUND,
241243
)
244+
except RoboflowAPITimeoutError as error:
245+
self._handle_error(
246+
request_id=request_id,
247+
error=error,
248+
public_error_message="Timed out connecting to Roboflow API during pipeline initialisation. "
249+
"Set ROBOFLOW_API_REQUEST_TIMEOUT to control the timeout.",
250+
error_type=ErrorType.OPERATION_ERROR,
251+
)
252+
except RoboflowAPIConnectionError as error:
253+
self._handle_error(
254+
request_id=request_id,
255+
error=error,
256+
public_error_message="Could not connect to Roboflow API during pipeline initialisation. "
257+
"Check network connectivity.",
258+
error_type=ErrorType.OPERATION_ERROR,
259+
)
242260
except WorkflowSyntaxError as error:
243261
self._handle_error(
244262
request_id=request_id,

0 commit comments

Comments
 (0)