Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better implementation of error handling when getting information for a non existing key #335

Closed
fluca1978 opened this issue Dec 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@fluca1978
Copy link
Collaborator

Related to #328 and #334 : if the user specifies a non existing key (not global) in the config-get subcommand the connection is dropped:

$ pgagroal-cli config-get limit.pgbench.max --verbose
Connection error on /tmp
pgagroal-cli: Error (1)

It would be nicer to report an error of some sort, so that the user can understand what happened and not blame the connection.

@fluca1978 fluca1978 added the bug Something isn't working label Dec 13, 2022
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Dec 13, 2022
This commit introduces a few constants to indicate if the
communication over the management socket has failed due to a
connection error or because the data received is not valid.
So far, only `config-get` returns a different value to indicate
invalid data over the socket, but other commands can take advanatge of
this too.

The `pgagroal-cli` main loop has been refactored to distinguish the
new cases, and now it prints the "connection error" message only when
the low level function reports such an error.

All the functions now return a specific value among those defined.

Close agroal#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant