Une coupure du gitlab et des services associés est prévue en tout début de matinée ce vendredi 19 août 2022 et ne devrait pas durer plus de 30 minutes.

Commit b7752e44 authored by Bruno Boiget's avatar Bruno Boiget
Browse files

Fix error message on server.describe if ID is unknown

parent a15332aa
from zephir.i18n import _
from .error import ServerErrorUnknownServerId
"""
List all servers
"""
......@@ -149,13 +151,16 @@ def list_all_servers(cursor):
def fetch_server_dict(cursor, serverid: int):
return server_row_to_dict(fetchone(cursor, FETCH_SERVER, (serverid,), raises=True), serverenvironment=True)
server = fetchone(cursor, FETCH_SERVER, (serverid,), raises=False)
if server is None:
raise ServerErrorUnknownServerId(_('Unable to find a server with ID {}').format(serverid))
return server_row_to_dict(server, serverenvironment=True)
def fetch_server(cursor, serverid: int):
fetched = fetchone(cursor, FETCH_SERVER, (serverid,))
if fetched is None:
raise Exception(_('unable to find a server with id {}').format(serverid))
raise Exception(_('unable to find a server with ID {}').format(serverid))
return fetched
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment