Skip to content

Commit

Permalink
Clarifying error message (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomerritt authored Nov 19, 2024
1 parent 67bec47 commit 83a8799
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sorcha/modules/PPReadPointingDatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ def PPReadPointingDatabase(bsdbname, observing_filters, dbquery, surveyname):

try:
df = pd.read_sql_query(dbquery, con)
except Exception:
except pd.errors.DatabaseError:
pplogger.error(
"ERROR: PPReadPointingDatabase: SQL query on pointing database failed. Check that the query is correct in the config file."
)
sys.exit(
"ERROR: PPReadPointingDatabase: SQL query on pointing database failed. Check that the query is correct in the config file."
)
except Exception as e: # pragma: no cover
pplogger.error(f"ERROR: PPReadPointingDatabase: error reading from pointing database: {e}")
sys.exit(f"ERROR: PPReadPointingDatabase: error reading from pointing database: {e}")

df["observationId_"] = df["observationId"]
df = df.rename(columns={"observationId": "FieldID"})
Expand Down

0 comments on commit 83a8799

Please sign in to comment.