mtx::errors namespace

Namespace for Matrix errors.

Classes

struct Error
Represents a Matrix related error.
struct LightweightError
Represents a Matrix related error.

Enums

enum class ErrorCode { M_UNRECOGNIZED, M_UNKNOWN, M_FORBIDDEN, M_UNKNOWN_TOKEN, M_BAD_JSON, M_NOT_JSON, M_NOT_FOUND, M_LIMIT_EXCEEDED, M_USER_IN_USE, M_INVALID_USERNAME, M_ROOM_IN_USE, M_INVALID_ROOM_STATE, M_BAD_PAGINATION, M_THREEPID_IN_USE, M_THREEPID_NOT_FOUND, M_SERVER_NOT_TRUSTED, M_MISSING_TOKEN, M_INVALID_SIGNATURE, M_EXCLUSIVE }
A Matrix error code.

Functions

auto to_string(ErrorCode code) -> std::string
Convert an error code into a string.
auto from_string(const std::string& code) -> ErrorCode
Parse an error code from a string.

Enum documentation

enum class mtx::errors::ErrorCode

A Matrix error code.

Enumerators
M_UNRECOGNIZED
M_UNKNOWN

unknown user or so

M_FORBIDDEN

Forbidden access, e.g. joining a room without permission, failed login.

M_UNKNOWN_TOKEN

The access token specified was not recognised.

M_BAD_JSON

Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys.

M_NOT_JSON

Request did not contain valid JSON.

M_NOT_FOUND

No resource was found for this request.

M_LIMIT_EXCEEDED

Too many requests have been sent in a short period of time.

M_USER_IN_USE

Encountered when trying to register a user ID which has been taken.

M_INVALID_USERNAME

Encountered when trying to register a user ID which is not valid.

M_ROOM_IN_USE

Sent when the room alias given to the createRoom API is already in use.

M_INVALID_ROOM_STATE

Sent when the intial state given to the createRoom API is invalid.

M_BAD_PAGINATION

Encountered when specifying bad pagination query parameters.

M_THREEPID_IN_USE

Sent when a threepid given to an API cannot be used because the same threepid is already in use.

M_THREEPID_NOT_FOUND

Sent when a threepid given to an API cannot be used because no record matching the threepid was found.

M_SERVER_NOT_TRUSTED

The client's request used a third party server, eg. ID server, that this server does not trust.

M_MISSING_TOKEN

The access token isn't present in the request.

M_INVALID_SIGNATURE

One of the uploaded signatures was invalid.

M_EXCLUSIVE

The resource being requested is reserved by an application service, or the application service making the request has not created the resource.

Function documentation

std::string mtx::errors::to_string(ErrorCode code)

Convert an error code into a string.

ErrorCode mtx::errors::from_string(const std::string& code)

Parse an error code from a string.