| 1 | package matrix |
| 2 | |
| 3 | import "errors" |
| 4 | |
| 5 | // Error definitions for the Matrix service. |
| 6 | // |
| 7 | // These errors are returned by various methods in the Matrix service package |
| 8 | // to indicate specific failure conditions during configuration, authentication, |
| 9 | // and message sending operations. |
| 10 | var ( |
| 11 | // ErrMissingHost is returned when the Matrix server host is not provided |
| 12 | // in the service configuration URL. |
| 13 | ErrMissingHost = errors.New("host is required") |
| 14 | |
| 15 | // ErrMissingCredentials is returned when neither a password nor an access |
| 16 | // token is provided in the service configuration URL. |
| 17 | ErrMissingCredentials = errors.New("password or access token is required") |
| 18 | |
| 19 | // ErrClientNotInitialized is returned when attempting to send a message |
| 20 | // but the Matrix client has not been properly initialized. |
| 21 | ErrClientNotInitialized = errors.New("client not initialized; cannot send message") |
| 22 | |
| 23 | // ErrUnsupportedLoginFlows is returned when none of the login flows |
| 24 | // supported by the server are compatible with this client. |
| 25 | ErrUnsupportedLoginFlows = errors.New("none of the server login flows are supported") |
| 26 | |
| 27 | // ErrUnexpectedStatus is returned when the Matrix API returns an HTTP |
| 28 | // status code that was not expected by the client. |
| 29 | ErrUnexpectedStatus = errors.New("unexpected HTTP status") |
| 30 | |
| 31 | // ErrEmptyRoom is returned when a room value is empty or contains only whitespace. |
| 32 | ErrEmptyRoom = errors.New("room value is empty") |
| 33 | ) |