jsonerror

package
v0.0.0-...-9835270 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalServerError

func InternalServerError() util.JSONResponse

InternalServerError returns a 500 Internal Server Error in a matrix-compliant format.

func ServerTimeout

func ServerTimeout(req *http.Request) util.JSONResponse

Types

type LimitExceededError

type LimitExceededError struct {
	MatrixError
	RetryAfterMS int64 `json:"retry_after_ms,omitempty"`
}

LimitExceededError is a rate-limiting error.

func LimitExceeded

func LimitExceeded(msg string, retryAfterMS int64) *LimitExceededError

LimitExceeded is an error when the client tries to send events too quickly.

type MatrixError

type MatrixError = internals.MatrixError

func ASExclusive

func ASExclusive(msg string) *MatrixError

ASExclusive is an error returned when an application service tries to register an username that is outside of its registered namespace, or if a user attempts to register a username within an exclusive namespace

func BadJSON

func BadJSON(msg string) *MatrixError

BadJSON is an error when the client supplies malformed JSON.

func Forbidden

func Forbidden(msg string) *MatrixError

Forbidden is an error when the client tries to access a resource they are not allowed to access.

func GuestAccessForbidden

func GuestAccessForbidden(msg string) *MatrixError

GuestAccessForbidden is an error which is returned when the client is forbidden from accessing a resource as a guest.

func InvalidArgumentValue

func InvalidArgumentValue(msg string) *MatrixError

InvalidArgumentValue is an error when the client tries to provide an invalid value for a valid argument

func InvalidUsername

func InvalidUsername(msg string) *MatrixError

InvalidUsername is an error returned when the client tries to register an invalid username

func MissingArgument

func MissingArgument(msg string) *MatrixError

MissingArgument is an error when the client tries to access a resource without providing an argument that is required.

func MissingEvent

func MissingEvent(msg string) *MatrixError

func MissingParam

func MissingParam(msg string) *MatrixError

func MissingToken

func MissingToken(msg string) *MatrixError

MissingToken is an error when the client tries to access a resource which requires authentication without supplying credentials.

func MsgDiscard

func MsgDiscard(msg string) *MatrixError

func NotFound

func NotFound(msg string) *MatrixError

NotFound is an error when the client tries to access an unknown resource.

func NotJSON

func NotJSON(msg string) *MatrixError

NotJSON is an error when the client supplies something that is not JSON to a JSON endpoint.

func NotTrusted

func NotTrusted(serverName string) *MatrixError

NotTrusted is an error which is returned when the client asks the server to proxy a request (e.g. 3PID association) to a server that isn't trusted

func PwdChangeKick

func PwdChangeKick(msg string) *MatrixError

func Timeout

func Timeout(msg string) *MatrixError

Unknown is an unexpected error

func Unknown

func Unknown(msg string) *MatrixError

Unknown is an unexpected error

func UnknownToken

func UnknownToken(msg string) *MatrixError

UnknownToken is an error when the client tries to access a resource which requires authentication and supplies an unrecognized token

func UserInUse

func UserInUse(msg string) *MatrixError

UserInUse is an error returned when the client tries to register an username that already exists

func WeakPassword

func WeakPassword(msg string) *MatrixError

WeakPassword is an error which is returned when the client tries to register using a weak password. http://matrix.org/docs/spec/client_server/r0.2.0.html#password-based

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL