Skip to content

Commit

Permalink
Changed Exception to HTTPException
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamFinkle committed Dec 9, 2024
1 parent 14ab035 commit 0329260
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion backend/etl/address_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.addresses import Address
from shapely.geometry import Point
Expand Down Expand Up @@ -59,5 +60,5 @@ def parse_data(self, data: dict) -> list[dict]:
addresses = handler.fetch_data()
address_objects = handler.parse_data(addresses)
handler.bulk_insert_data(address_objects, "eas_fullid")
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")
3 changes: 2 additions & 1 deletion backend/etl/landslide_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.landslide_zones import LandslideZone
from shapely.geometry import shape
Expand Down Expand Up @@ -52,5 +53,5 @@ def parse_data(self, data: dict) -> list[dict]:
lanslide_zones = handler.fetch_data()
lanslide_zone_objects = handler.parse_data(lanslide_zones)
handler.bulk_insert_data(lanslide_zone_objects, "identifier")
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")
3 changes: 2 additions & 1 deletion backend/etl/liquefaction_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.liquefaction_zones import LiquefactionZone
from shapely.geometry import shape
Expand Down Expand Up @@ -45,5 +46,5 @@ def parse_data(self, data: dict) -> list[dict]:
liquefaction_zones = handler.fetch_data()
liquefaction_zones_objects = handler.parse_data(liquefaction_zones)
handler.bulk_insert_data(liquefaction_zones_objects, "identifier")
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")
3 changes: 2 additions & 1 deletion backend/etl/seismic_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.seismic_hazard_zones import SeismicHazardZone
from shapely.geometry import shape
Expand Down Expand Up @@ -43,5 +44,5 @@ def parse_data(self, data: dict) -> list[dict]:
seismic_zones = handler.fetch_data()
seismic_zone_objects = handler.parse_data(seismic_zones)
handler.bulk_insert_data(seismic_zone_objects, "identifier")
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")
3 changes: 2 additions & 1 deletion backend/etl/soft_story_properties_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.soft_story_properties import SoftStoryProperty

Expand Down Expand Up @@ -54,5 +55,5 @@ def parse_data(self, data: dict) -> list[dict]:
soft_story_properties = handler.fetch_data()
soft_story_property_objects = handler.parse_data(soft_story_properties)
handler.bulk_insert_data_autoincremented(soft_story_property_objects)
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")
3 changes: 2 additions & 1 deletion backend/etl/tsunami_data_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http.client import HTTPException
from backend.etl.data_handler import DataHandler
from backend.api.models.tsunami import TsunamiZone
from shapely.geometry import Polygon, MultiPolygon
Expand Down Expand Up @@ -62,5 +63,5 @@ def parse_data(self, data: dict) -> list[dict]:
tsunami_zones = handler.fetch_data(params)
tsunami_zones_objects = handler.parse_data(tsunami_zones)
handler.bulk_insert_data(tsunami_zones_objects, "identifier")
except Exception as e:
except HTTPException as e:
print(f"Failed after retries: {e}")

0 comments on commit 0329260

Please sign in to comment.