Skip to content

Commit ced11a3

Browse files
committed
refactored main.py
1 parent c864a09 commit ced11a3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/rowgen/extract_from_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Extracts schema information from a SQL database with comprehensive error handling.
33
"""
44

5-
from typing import Dict, List, Any
5+
from typing import Any, Dict, List
66

77
from sqlalchemy import create_engine, inspect
88
from sqlalchemy.exc import SQLAlchemyError

src/rowgen/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def get_api_key_from_config() -> str:
128128
return line.split(":", 1)[1].strip()
129129
except PermissionError:
130130
print("Error: No permission to read the config file.")
131-
raise SystemExit(1)
131+
raise SystemExit(1) from None
132132
except Exception as e:
133133
print(f"Error reading config: {e}")
134-
raise SystemExit(1)
134+
raise SystemExit(1) from None
135135

136136
# Prompt for new API key
137137
apikey = input("Enter your HuggingFace API key: ").strip()
@@ -181,7 +181,7 @@ def main() -> None:
181181

182182
except Exception as e:
183183
print(f"Error: {e}")
184-
raise SystemExit(1)
184+
raise SystemExit(1) from None
185185

186186

187187
if __name__ == "__main__":

0 commit comments

Comments
 (0)