Skip to content

Commit

Permalink
Error handling (#219)
Browse files Browse the repository at this point in the history
* adding cmf exception and success code classes

* check applied to minios3to check files download failed or assed

* adding changes to metadata push

* updated init, artifact, metadata, storage_backend with exception handling

* made changes to metadata push and renumbered all status codes

* removed print statements, added error handling to osdf init

* Fixed error occured during testing

* update

* update

* made some changes in local_artifacts.py and other files

* adding minio_artifact.py code

* changing way of writing amazons3_artifacts.py

* adding ssh remote changes

* changed the method for handling cmf exception for ssh remote

* added comments

* added cmf exception and success handling also did testing

* update

* made some review changes

* update

* addressed review comments

* addressed review comments

* addressed revieew comments

* updated except block in amazons3

* Update pull.py

* fixed osdf bug temporarily to fix master branch

---------

Co-authored-by: First Second <[email protected]>
Co-authored-by: AyeshaSanadi <[email protected]>
Co-authored-by: AyeshaSanadi <[email protected]>
Co-authored-by: Varkha Sharma <[email protected]>
  • Loading branch information
5 people authored Jan 8, 2025
1 parent c05fe13 commit f7dcb90
Show file tree
Hide file tree
Showing 24 changed files with 1,555 additions and 529 deletions.
11 changes: 8 additions & 3 deletions cmflib/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -36,6 +36,7 @@ def parse_args(argv=None):

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

args.parser = parser
return args

Expand All @@ -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

0 comments on commit f7dcb90

Please sign in to comment.