This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lensesio/exceptions] raise exceptions rather exiting
Issue: Lenses is a module and hence shoud raise exceptions rather exiting and causing the whole application to exit Reporter: #56 Fix: switch all lines of lensesio.lenses.main from print&exit to raise lenses_exception(e)
- Loading branch information
Christos Kotsis
committed
Apr 16, 2021
1 parent
645b44c
commit 68590e5
Showing
2 changed files
with
40 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
|
||
|
||
class lenses_exception(Exception): | ||
def __init__(self, error): | ||
self.error = error | ||
class lenses_exception(BaseException): | ||
def __init__(self, value): | ||
self.value = value | ||
|
||
def __str__(self): | ||
return(repr(self.value)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters