mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
better error message when trying to set invalid config key
This commit is contained in:
parent
1516f27b76
commit
4203355d7d
|
@ -362,10 +362,15 @@ def cli_config_list(ctx: click.Context) -> None:
|
|||
def cli_config_set(ctx: click.Context, key: str, value: Any) -> None:
|
||||
'Set a config value'
|
||||
|
||||
with ctx.obj.database.session() as conn:
|
||||
new_value = conn.put_config(key, value)
|
||||
try:
|
||||
with ctx.obj.database.session() as conn:
|
||||
new_value = conn.put_config(key, value)
|
||||
|
||||
print(f'{key}: {repr(new_value)}')
|
||||
except:
|
||||
click.echo('Invalid config name:', key)
|
||||
return
|
||||
|
||||
click.echo(f'{key}: {repr(new_value)}')
|
||||
|
||||
|
||||
@cli.group('user')
|
||||
|
|
Loading…
Reference in a new issue