-
Notifications
You must be signed in to change notification settings - Fork 1
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 #46 from smart-on-fhir/mikix/better-error-msg
fix: give better explanations for invalid project folders
- Loading branch information
Showing
4 changed files
with
50 additions
and
24 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
from typing import NoReturn | ||
|
||
import rich.console | ||
|
||
ERROR_INVALID_PROJECT = 10 | ||
|
||
|
||
def exit_for_invalid_project(msg: str) -> NoReturn: | ||
# Be very helpful - this is likely the user's first interaction with chart-review. | ||
stderr = rich.console.Console(stderr=True) | ||
stderr.print(msg, style="bold red", highlight=False) | ||
stderr.print() | ||
stderr.print("This does not appear to be a chart-review project folder.") | ||
stderr.print("See https://docs.smarthealthit.org/cumulus/chart-review/ to set up your project.") | ||
stderr.print() | ||
stderr.print("Or pass --help for usage info.") | ||
sys.exit(ERROR_INVALID_PROJECT) |
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