From 454e27239cdb5ec111b85ff200ec75ef6fdc70ab Mon Sep 17 00:00:00 2001 From: Sorunome Date: Tue, 7 Dec 2021 21:10:59 +0100 Subject: [PATCH] chore: Add missing matrix error types as per spec The full list of error codes is here: https://spec.matrix.org/v1.1/client-server-api/#standard-error-response --- lib/src/model/matrix_exception.dart | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/src/model/matrix_exception.dart b/lib/src/model/matrix_exception.dart index 3e7ef751..822d9845 100644 --- a/lib/src/model/matrix_exception.dart +++ b/lib/src/model/matrix_exception.dart @@ -1,17 +1,17 @@ /* MIT License -* +* * Copyright (C) 2019, 2020, 2021 Famedly GmbH -* +* * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: -* +* * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. -* +* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -40,6 +40,23 @@ enum MatrixError { M_MISSING_PARAM, M_UNSUPPORTED_ROOM_VERSION, M_UNRECOGNIZED, + M_BAD_JSON, + M_NOT_JSON, + M_UNAUTHORIZED, + M_USER_DEACTIVATED, + M_INVALID_USERNAME, + M_ROOM_IN_USE, + M_INVALID_ROOM_STATE, + M_SERVER_NOT_TRUSTED, + M_INCOMPATIBLE_ROOM_VERSION, + M_BAD_STATE, + M_GUEST_ACCESS_FORBIDDEN, + M_CAPTCHA_NEEDED, + M_CAPTCHA_INVALID, + M_INVALID_PARAM, + M_EXCLUSIVE, + M_RESOURCE_LIMIT_EXCEEDED, + M_CANNOT_LEAVE_SERVER_NOTICE_ROOM, } /// Represents a special response from the Homeserver for errors.