gmshairfoil2d 0.1.4__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ from pathlib import Path
2
2
 
3
3
  import numpy as np
4
4
  import requests
5
+ import sys
5
6
 
6
7
  import gmshairfoil2d.__init__
7
8
 
@@ -49,8 +50,17 @@ def get_airfoil_file(airfoil_name):
49
50
 
50
51
  r = requests.get(url)
51
52
 
52
- if r.status_code != 200:
53
- raise Exception(f"Could not get airfoil {airfoil_name}")
53
+ try:
54
+ r = requests.get(url, timeout=10) # Aggiungi sempre un timeout
55
+ if r.status_code != 200:
56
+ # Invece di raise Exception, print e exit pulito
57
+ print(f"❌ Error: Could not find airfoil '{airfoil_name}' on UIUC database.")
58
+ import sys
59
+ sys.exit(1)
60
+ except requests.exceptions.RequestException as e:
61
+ print(f"❌ Network Error: Could not connect to the database. Check your internet.")
62
+ import sys
63
+ sys.exit(1)
54
64
 
55
65
  file_path = Path(database_dir, f"{airfoil_name}.dat")
56
66