Skip to content

Commit

Permalink
Merge pull request #1197 from doronz88/bugfix/tunneld-coredevice-igno…
Browse files Browse the repository at this point in the history
…re-error

tunneld: ignore `ConnectionAbortedError` raised from `CoreDeviceProxy`
  • Loading branch information
doronz88 authored Sep 11, 2024
2 parents f755482 + 26856a0 commit dae7c72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pymobiledevice3/tunneld.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ async def monitor_usbmux_task(self) -> None:
continue
try:
service = CoreDeviceTunnelProxy(create_using_usbmux(mux_device.serial))
except (MuxException, InvalidServiceError, GetProhibitedError, construct.core.StreamError):
except (MuxException, InvalidServiceError, GetProhibitedError, construct.core.StreamError,
ConnectionAbortedError):
continue
self.tunnel_tasks[task_identifier] = TunnelTask(
udid=mux_device.serial,
Expand Down Expand Up @@ -380,7 +381,8 @@ async def clear_tunnels() -> fastapi.Response:
@self._app.get('/cancel')
async def cancel_tunnel(udid: str) -> fastapi.Response:
self._tunneld_core.cancel(udid=udid)
data = json.dumps({'operation': 'cancel', 'udid': udid, 'data': True, 'message': f'tunnel {udid} Canceled ...'})
data = json.dumps(
{'operation': 'cancel', 'udid': udid, 'data': True, 'message': f'tunnel {udid} Canceled ...'})
return generate_http_response(data)

@self._app.get('/hello')
Expand Down

0 comments on commit dae7c72

Please sign in to comment.