Skip to content

Commit

Permalink
excepions
Browse files Browse the repository at this point in the history
  • Loading branch information
womullan committed Feb 27, 2024
1 parent 76ca075 commit a674f7e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/lsst/consdb/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from pandas import DataFrame
import requests
from requests.exceptions import RequestException
from typing import Any, Iterable
from urllib.parse import urljoin

Expand All @@ -15,8 +16,8 @@ def insert(table: str, values: dict[str, Any], **kwargs):
url = urljoin(base_url, "insert")
try:
response = requests.post(url, json=data)
except:
raise
except (RequestException) as e:
raise e
response.raise_for_status()


Expand All @@ -35,8 +36,8 @@ def query(
data = {"tables": tables, "columns": columns, "where": where, "join": join}
try:
response = requests.post(url, json=data)
except:
raise
except (RequestException) as e:
raise e
try:
response.raise_for_status()
except:
Expand All @@ -51,7 +52,7 @@ def schema(table: str):
url = urljoin(url, table)
try:
response = requests.get(url)
except:
raise
except (RequestException) as e:
raise e
response.raise_for_status()
return response.json()

0 comments on commit a674f7e

Please sign in to comment.