Skip to content

Commit

Permalink
kernelci.cli.storage: catch exceptions
Browse files Browse the repository at this point in the history
Use `catch_error` decorator to catch exceptions
like `HTTPError` and `KeyError` and raise
`ClickException`.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia authored and nuclearcat committed Dec 29, 2023
1 parent 9b0e7a8 commit 2f4f5b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernelci/cli/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import kernelci.config
import kernelci.storage
from . import Args, kci
from . import Args, kci, catch_error


@kci.group(name='storage')
Expand All @@ -24,6 +24,7 @@ def kci_storage():
@click.argument('path', required=False)
@Args.config
@Args.storage
@catch_error
def upload(filename, path, config, storage, secrets):
"""Upload FILENAME to the designated storage service in PATH"""
configs = kernelci.config.load(config)
Expand Down

0 comments on commit 2f4f5b0

Please sign in to comment.