Skip to content

Commit bba45f7

Browse files
author
Samson Gebre
committed
Improve error handling for missing libcst dependency in migration script
1 parent 8e61fd3 commit bba45f7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

tools/migrate_v0_to_v1.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,12 @@
8787

8888
try:
8989
import libcst as cst
90-
except ImportError:
91-
print(
92-
"ERROR: libcst is required. Install with:\n"
90+
except ImportError as _e:
91+
raise ImportError(
92+
"libcst is required. Install with:\n"
9393
" pip install PowerPlatform-Dataverse-Client[migration]\n"
94-
" # or: pip install 'libcst>=1.0.0'",
95-
file=sys.stderr,
96-
)
97-
sys.exit(1)
94+
" # or: pip install 'libcst>=1.0.0'"
95+
) from _e
9896

9997

10098
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)