register_server: Improve UX with the "hostname already in use" error.

An even better way than the current json error message recommending the
--registration-transfer option is to return an appropriate error code
and have that get picked up by the register_server command.

The register_server command can then display a more comprehensive,
better formatted error message with proper whitespaces and a pointer to
the documentation.
This commit is contained in:
Mateusz Mandera
2025-01-29 20:53:46 +08:00
committed by Tim Abbott
parent 6d555b01d0
commit ddcc36c3aa
5 changed files with 38 additions and 14 deletions

View File

@@ -57,6 +57,7 @@ class ErrorCode(Enum):
CANNOT_DEACTIVATE_GROUP_IN_USE = auto()
CANNOT_ADMINISTER_CHANNEL = auto()
REMOTE_SERVER_VERIFICATION_SECRET_NOT_PREPARED = auto()
HOSTNAME_ALREADY_IN_USE_BOUNCER_ERROR = auto()
class JsonableError(Exception):