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

Error handling #219

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a74dc78
adding cmf exception and success code classes
Nov 21, 2024
b83956f
check applied to minios3to check files download failed or assed
Nov 22, 2024
e03d675
adding changes to metadata push
Dec 4, 2024
cbdb4ae
updated init, artifact, metadata, storage_backend with exception hand…
Dec 4, 2024
75b6af2
Merge branch 'HewlettPackard:master' into error_handling
AyeshaSanadi Dec 5, 2024
2a6e8a8
made changes to metadata push and renumbered all status codes
Dec 5, 2024
9d61555
removed print statements, added error handling to osdf init
Dec 9, 2024
6e44cc3
Fixed error occured during testing
AyeshaSanadi Dec 9, 2024
6db3409
Merge remote-tracking branch 'origin/master' into error_handling
Dec 12, 2024
5825d91
update
Dec 12, 2024
1bf5865
update
Dec 13, 2024
a02e5e2
made some changes in local_artifacts.py and other files
varkha-d-sharma Dec 13, 2024
7bc9b73
adding minio_artifact.py code
varkha-d-sharma Dec 13, 2024
f911270
changing way of writing amazons3_artifacts.py
Dec 16, 2024
11430ac
adding ssh remote changes
varkha-d-sharma Dec 16, 2024
fe2e3a1
changed the method for handling cmf exception for ssh remote
Dec 16, 2024
482c1e0
added comments
Dec 16, 2024
66aa912
Merge remote-tracking branch 'origin/master' into error_handling
Dec 18, 2024
a173286
added cmf exception and success handling also did testing
Dec 18, 2024
b1238f3
Merge branch 'HewlettPackard:master' into error_handling
abhinavchobey Dec 20, 2024
9c15ad6
update
Dec 20, 2024
355ef8d
made some review changes
varkha-d-sharma Dec 20, 2024
0dc64a6
update
Dec 20, 2024
fabf410
addressed review comments
varkha-d-sharma Dec 20, 2024
e2ec3fd
addressed review comments
varkha-d-sharma Dec 20, 2024
4e0377f
addressed revieew comments
varkha-d-sharma Dec 20, 2024
968d3dd
updated except block in amazons3
Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cmflib/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###

from cmflib.cmf_exception_handling import CmfResponse

class CmfParserError(Exception):
"""Base class for CLI parser errors."""
@@ -36,6 +36,7 @@ def parse_args(argv=None):

parser = get_main_parser()
args = parser.parse_args(argv)

args.parser = parser
return args

@@ -54,10 +55,14 @@ def main(argv=None):
args = parse_args(argv)
cmd = args.func(args)
msg = cmd.do_run()
print(msg)
print(msg.handle())
except CmfResponse as e:
print(e.handle())
except CmfParserError:
pass
pass
except KeyboardInterrupt:
print("Interrupted by the user")
except Exception as e:
print(e)


Loading