Skip to content

Commit

Permalink
Raise DeviceLockedError when launching app
Browse files Browse the repository at this point in the history
  • Loading branch information
morellexf13 committed May 8, 2024
1 parent 095d3e5 commit d46d026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymobiledevice3/services/dvt/instruments/process_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import typing

from pymobiledevice3.exceptions import DeviceHasPasscodeSetError, DvtException
from pymobiledevice3.exceptions import DvtException, DeviceLockedError
from pymobiledevice3.services.dvt.dvt_secure_socket_proxy import DvtSecureSocketProxyService
from pymobiledevice3.services.remote_server import MessageAux

Expand Down Expand Up @@ -79,7 +79,7 @@ def launch(self, bundle_id: str, arguments=None, kill_existing: bool = True, sta
result = self._channel.receive_plist()
except DvtException as exc:
error = exc.args[0]["NSLocalizedFailureReason"]
raise DeviceHasPasscodeSetError() if "the device was not, or could not be, unlocked" in error else error
raise DeviceLockedError() if "the device was not, or could not be, unlocked" in error else error
assert result
return result

Expand Down

0 comments on commit d46d026

Please sign in to comment.