Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py @ 4262:d366d90a71aa
component AP Gateway: log invalid account in case of error.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 12 Jun 2024 22:34:19 +0200 |
parents | 49019947cc76 |
children | 0d7bb4df2343 |
comparison
equal
deleted
inserted
replaced
4261:5f83bba6cd27 | 4262:d366d90a71aa |
---|---|
838 nodes that plugins may hanlde) will be used | 838 nodes that plugins may hanlde) will be used |
839 @raise ValueError: invalid account | 839 @raise ValueError: invalid account |
840 @raise PermissionError: non local jid is used when gateway doesn't allow them | 840 @raise PermissionError: non local jid is used when gateway doesn't allow them |
841 """ | 841 """ |
842 if ap_account.count("@") != 1: | 842 if ap_account.count("@") != 1: |
843 raise ValueError("Invalid AP account") | 843 raise ValueError(f"Invalid AP account {ap_account!r}") |
844 if ap_account.startswith("___"): | 844 if ap_account.startswith("___"): |
845 encoded = True | 845 encoded = True |
846 ap_account = ap_account[3:] | 846 ap_account = ap_account[3:] |
847 else: | 847 else: |
848 encoded = False | 848 encoded = False |