-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from DOED-DAAD/dev
updated cli error handling
- Loading branch information
Showing
6 changed files
with
38 additions
and
28 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,4 +1,5 @@ | ||
.pytest** | ||
.ruff_cache | ||
__pycache__ | ||
.vscode | ||
.vscode | ||
errors.txt |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ requires-python = ">=3.8" | |
license = "MIT" | ||
keywords = [] | ||
authors = [ | ||
{ name = "Matthew Wells", email = "[email protected]" }, | ||
{ name = "Matthew Wells", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
|
@@ -36,7 +36,7 @@ Issues = "https://github.com/unknown/mikrokondo-tools/issues" | |
Source = "https://github.com/unknown/mikrokondo-tools" | ||
|
||
[project.scripts] | ||
mikrokondo-tools = "mikrokondo_tools.cli:mikrokondo_tools" | ||
mikrokondo-tools = "mikrokondo_tools.cli:safe_entry_point" | ||
|
||
[tool.hatch.version] | ||
path = "src/mikrokondo_tools/__about__.py" | ||
|
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,25 +1,10 @@ | ||
# SPDX-FileCopyrightText: 2024-present Matthew Wells <[email protected]> | ||
# SPDX-FileCopyrightText: 2024-present Matthew Wells <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
import sys | ||
import traceback | ||
import mikrokondo_tools.utils as u | ||
|
||
|
||
if __name__ == "__main__": | ||
#from mikrokondo_tools.cli import mikrokondo_tools | ||
from mikrokondo_tools.cli import main | ||
logger = u.get_logger(__name__) | ||
|
||
try: | ||
main() | ||
except Exception as e: | ||
errors_out = "errors.txt" | ||
logger.warning("Error encountered appending traceback to %s", errors_out) | ||
with open(errors_out, 'r') as output: | ||
output.write(traceback.format_exc()) | ||
error_number = e.errno if hasattr(e, "errno") else -1 | ||
SystemExit(error_number) | ||
else: | ||
logger.info("Program finished.") | ||
|
||
sys.exit(0) | ||
sys.exit(main()) |
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
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
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