mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-18 13:39:13 -04:00
Make get_device
return None if the device doesn't exist rather than raising an exception. (#11565)
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
This commit is contained in:
parent
aa8708ebed
commit
e5cdb9e233
6 changed files with 20 additions and 13 deletions
|
@ -63,6 +63,8 @@ class DeviceRestServlet(RestServlet):
|
|||
device = await self.device_handler.get_device(
|
||||
target_user.to_string(), device_id
|
||||
)
|
||||
if device is None:
|
||||
raise NotFoundError("No device found")
|
||||
return HTTPStatus.OK, device
|
||||
|
||||
async def on_DELETE(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue