mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2025-06-27 15:20:24 +01:00
add exception group handling for all commands that may raise exceptions add comments to for-else blocks
14 lines
354 B
Python
14 lines
354 B
Python
import asyncclick as click
|
|
|
|
|
|
class SlobsCliError(click.ClickException):
|
|
"""Base class for all Slobs CLI errors."""
|
|
|
|
def __init__(self, message: str):
|
|
super().__init__(message)
|
|
self.exit_code = 1
|
|
|
|
def show(self):
|
|
"""Display the error message in red."""
|
|
click.secho(f"Error: {self.message}", fg="red", err=True)
|