Abandon fetching offline presence on 400 error
It seems like some servers return a M_UNRECOGNIZED code instead of M_FORBIDDEN or "offline" when trying to fetch the presence for a user and it's not available. Fixes https://github.com/mirukana/mirage/issues/116
This commit is contained in:
@@ -33,6 +33,12 @@ class MatrixError(Exception):
|
||||
return cls(response.transport_response.status, response.status_code)
|
||||
|
||||
|
||||
@dataclass
|
||||
class MatrixUnrecognized(MatrixError):
|
||||
http_code: int = 400
|
||||
m_code: str = "M_UNRECOGNIZED"
|
||||
|
||||
|
||||
@dataclass
|
||||
class MatrixInvalidAccessToken(MatrixError):
|
||||
http_code: int = 401
|
||||
|
||||
Reference in New Issue
Block a user