Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
664c81e8
Commit
664c81e8
authored
6 years ago
by
Hubert Chathi
Browse files
Options
Downloads
Patches
Plain Diff
return proper error codes for some 404s
parent
ef43a03f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/e2e_room_keys.py
+16
-4
16 additions, 4 deletions
synapse/handlers/e2e_room_keys.py
with
16 additions
and
4 deletions
synapse/handlers/e2e_room_keys.py
+
16
−
4
View file @
664c81e8
...
@@ -267,7 +267,7 @@ class E2eRoomKeysHandler(object):
...
@@ -267,7 +267,7 @@ class E2eRoomKeysHandler(object):
version(str): Optional; if None gives the most recent version
version(str): Optional; if None gives the most recent version
otherwise a historical one.
otherwise a historical one.
Raises:
Raises:
StoreError: code 404
if the requested backup version doesn
'
t exist
NotFoundError:
if the requested backup version doesn
'
t exist
Returns:
Returns:
A deferred of a info dict that gives the info about the new version.
A deferred of a info dict that gives the info about the new version.
...
@@ -279,7 +279,13 @@ class E2eRoomKeysHandler(object):
...
@@ -279,7 +279,13 @@ class E2eRoomKeysHandler(object):
"""
"""
with
(
yield
self
.
_upload_linearizer
.
queue
(
user_id
)):
with
(
yield
self
.
_upload_linearizer
.
queue
(
user_id
)):
res
=
yield
self
.
store
.
get_e2e_room_keys_version_info
(
user_id
,
version
)
try
:
res
=
yield
self
.
store
.
get_e2e_room_keys_version_info
(
user_id
,
version
)
except
StoreError
as
e
:
if
e
.
code
==
404
:
raise
NotFoundError
(
"
Unknown backup version
"
)
else
:
raise
defer
.
returnValue
(
res
)
defer
.
returnValue
(
res
)
@defer.inlineCallbacks
@defer.inlineCallbacks
...
@@ -290,8 +296,14 @@ class E2eRoomKeysHandler(object):
...
@@ -290,8 +296,14 @@ class E2eRoomKeysHandler(object):
user_id(str): the user whose current backup version we
'
re deleting
user_id(str): the user whose current backup version we
'
re deleting
version(str): the version id of the backup being deleted
version(str): the version id of the backup being deleted
Raises:
Raises:
StoreError: code 404
if this backup version doesn
'
t exist
NotFoundError:
if this backup version doesn
'
t exist
"""
"""
with
(
yield
self
.
_upload_linearizer
.
queue
(
user_id
)):
with
(
yield
self
.
_upload_linearizer
.
queue
(
user_id
)):
yield
self
.
store
.
delete_e2e_room_keys_version
(
user_id
,
version
)
try
:
yield
self
.
store
.
delete_e2e_room_keys_version
(
user_id
,
version
)
except
StoreError
as
e
:
if
e
.
code
==
404
:
raise
NotFoundError
(
"
Unknown backup version
"
)
else
:
raise
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment