Skip to content

Commit

Permalink
catch a missing table error datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Jul 8, 2024
1 parent 5387ac2 commit c52aab5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/charts/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import requests
import sqlalchemy as sa
from sqlalchemy.exc import ProgrammingError
from psycopg2.errors import UndefinedTable

from ckanext.datastore.backend.postgres import get_read_engine

Expand Down Expand Up @@ -75,7 +76,7 @@ def fetch_data(self) -> pd.DataFrame:
# TODO: hack... Convert all columns to numeric if possible
df = cast(pd.DataFrame, df.apply(pd.to_numeric, errors='ignore').fillna(0))

except ProgrammingError as e:
except (ProgrammingError, UndefinedTable) as e:
raise exception.DataFetchError(
f"An error occurred during fetching data from DataStore: {e}",
) from e
Expand Down

0 comments on commit c52aab5

Please sign in to comment.