diff options
author | 2024-03-31 19:41:26 +0100 | |
---|---|---|
committer | 2024-03-31 19:41:26 +0100 | |
commit | daf5a1dc8c477af458ff2a08b2d10bab2cb68904 (patch) | |
tree | a18dd8870c8a97dd8ad27ef207d71714b0b507dc | |
parent | correct debug line to print resolved pod names (diff) |
handle 404 differently in pod logs command
-rw-r--r-- | arthur/exts/kubernetes/pods.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arthur/exts/kubernetes/pods.py b/arthur/exts/kubernetes/pods.py index ee0b0c9..5887756 100644 --- a/arthur/exts/kubernetes/pods.py +++ b/arthur/exts/kubernetes/pods.py @@ -122,6 +122,12 @@ class Pods(commands.Cog): try: logs = await pods.tail_pod(namespace, pod, lines=lines) except ApiException as e: + if e.status == 404: # noqa: PLR2004, 404 is a known error + return await ctx.send( + generate_error_message( + description="Pod or namespace not found, check the name." + ) + ) return await ctx.send(generate_error_message(description=str(e))) if len(logs) == 0: |