Skip to content

Commit

Permalink
fix: remove bots error
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdang committed Jan 17, 2025
1 parent f67ea6c commit 3f7e273
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion docs/commands/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CLI commands for interacting with the Silverback Platform.
.. click:: silverback._cli:bots
:prog: silverback cluster bots
:nested: full
:commands: new, list, info, update, remove, health, start, stop, logs, errors
:commands: new, list, info, update, remove, health, start, stop, logs

.. click:: silverback._cli:pay
:prog: silverback cluster pay
Expand Down
3 changes: 0 additions & 3 deletions docs/userguides/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ We already saw how you can use the [`silverback cluster bots list`][silverback-c

To see runtime health information about a specific bot, again use the [`silverback cluster bots health`][silverback-cluster-bots-health] command.
You can view the logs that a specific bot is generating using the [`silverback cluster bots logs`][silverback-cluster-bots-logs] command.
Lastly, you can view unacknowledged errors that your bot has experienced while in the RUNNING state
using the [`silverback cluster bots errors`][silverback-cluster-bots-errors] command.

```{warning}
Once in the RUNNING state, your Bot will not stop running unless it experiences a certain amount of errors in quick succession.
Expand Down Expand Up @@ -188,7 +186,6 @@ TODO: Downloading metrics from your Bot

[silverback-build]: ../commands/run.html#silverback-build
[silverback-cluster-bots]: ../commands/cluster.html#silverback-cluster-bots
[silverback-cluster-bots-errors]: ../commands/cluster.html#silverback-cluster-bots-errors
[silverback-cluster-bots-health]: ../commands/cluster.html#silverback-cluster-bots-health
[silverback-cluster-bots-info]: ../commands/cluster.html#silverback-cluster-bots-info
[silverback-cluster-bots-list]: ../commands/cluster.html#silverback-cluster-bots-list
Expand Down
13 changes: 0 additions & 13 deletions silverback/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,16 +1304,3 @@ def show_bot_logs(cluster: "ClusterClient", name: str, log_level: str, since: ti

for log in bot.filter_logs(log_level=level, start_time=start_time):
click.echo(log)


@bots.command(name="errors", section="Bot Operation Commands")
@click.argument("name", metavar="BOT")
@cluster_client
def show_bot_errors(cluster: "ClusterClient", name: str):
"""Show unacknowledged errors for BOT in CLUSTER"""

if not (bot := cluster.bots.get(name)):
raise click.UsageError(f"Unknown bot '{name}'.")

for log in bot.errors:
click.echo(log)
6 changes: 0 additions & 6 deletions silverback/cluster/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@ def registry_credentials(self) -> RegistryCredentials | None:
return v
return None

@property
def errors(self) -> list[str]:
response = self.cluster.get(f"/bots/{self.name}/errors")
handle_error_with_response(response)
return response.json()

def filter_logs(
self,
log_level: LogLevel = LogLevel.INFO,
Expand Down

0 comments on commit 3f7e273

Please sign in to comment.