From b609e150b811700f3a429f0dd653b96f1be511d9 Mon Sep 17 00:00:00 2001 From: notoraptor Date: Thu, 25 Oct 2018 11:20:56 -0400 Subject: Map - Modified norm() and compact() - Added 'loc' arg to get_order_status - Raising exception on set_orders for invalid power - Deprecated game.distribute_orders --- diplomacy/utils/exceptions.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'diplomacy/utils') diff --git a/diplomacy/utils/exceptions.py b/diplomacy/utils/exceptions.py index 4d564a3..5cf4384 100644 --- a/diplomacy/utils/exceptions.py +++ b/diplomacy/utils/exceptions.py @@ -101,6 +101,9 @@ class GameIdException(ResponseException): class GameJoinRoleException(ResponseException): """ A token can have only one role inside a game: player, observer or omniscient. """ +class GameRoleException(ResponseException): + """ Game role does not accepts this action. """ + class GameMasterTokenException(ResponseException): """ Invalid token for master operations. """ @@ -145,17 +148,11 @@ class MapPowerException(ResponseException): def __init__(self, power_name): super(MapPowerException, self).__init__('Invalid map power %s' % power_name) -class ServerDataDirException(ResponseException): - """ No data directory available in server folder. """ - class FolderException(ResponseException): """ Given folder not available in server. """ def __init__(self, folder_path): super(FolderException, self).__init__('Given folder not available in server: %s' % folder_path) -class ServerGameDirException(ResponseException): - """ No games directory available in server/data folder. """ - class ServerRegistrationException(ResponseException): """ Registration currently not allowed on this server. """ @@ -168,9 +165,6 @@ class UserException(ResponseException): class PasswordException(ResponseException): """ Password must not be empty. """ -class VoteCreationException(ResponseException): - """ Only either a player or a game master for a game with at least 1 player can create a vote. """ - class ServerDirException(ResponseException): """ Error with working folder. """ -- cgit v1.2.3