mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
Name the type of token in "Invalid token" messages (#10815)
I had one of these error messages yesterday and assumed it was an invalid auth token (because that was an HTTP query parameter in the test) I was working on. In fact, it was an invalid next batch token for syncing.
This commit is contained in:
parent
01c88a09cd
commit
319b8b6bef
4 changed files with 7 additions and 6 deletions
|
@ -511,7 +511,7 @@ class RoomStreamToken:
|
|||
)
|
||||
except Exception:
|
||||
pass
|
||||
raise SynapseError(400, "Invalid token %r" % (string,))
|
||||
raise SynapseError(400, "Invalid room stream token %r" % (string,))
|
||||
|
||||
@classmethod
|
||||
def parse_stream_token(cls, string: str) -> "RoomStreamToken":
|
||||
|
@ -520,7 +520,7 @@ class RoomStreamToken:
|
|||
return cls(topological=None, stream=int(string[1:]))
|
||||
except Exception:
|
||||
pass
|
||||
raise SynapseError(400, "Invalid token %r" % (string,))
|
||||
raise SynapseError(400, "Invalid room stream token %r" % (string,))
|
||||
|
||||
def copy_and_advance(self, other: "RoomStreamToken") -> "RoomStreamToken":
|
||||
"""Return a new token such that if an event is after both this token and
|
||||
|
@ -619,7 +619,7 @@ class StreamToken:
|
|||
await RoomStreamToken.parse(store, keys[0]), *(int(k) for k in keys[1:])
|
||||
)
|
||||
except Exception:
|
||||
raise SynapseError(400, "Invalid Token")
|
||||
raise SynapseError(400, "Invalid stream token")
|
||||
|
||||
async def to_string(self, store: "DataStore") -> str:
|
||||
return self._SEPARATOR.join(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue