Skip to content

Commit

Permalink
adding small enhancement for handling exceptions on HttpHook
Browse files Browse the repository at this point in the history
adding env variables requirement for future use
  • Loading branch information
sunset666 committed Feb 7, 2023
1 parent 1ddcc17 commit 96e3be7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ingest-pipeline/airflow/dags/trigger_file_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from airflow.operators.python import PythonOperator
from airflow.providers.http.hooks.http import HttpHook
from airflow.configuration import conf as airflow_conf
from airflow.exceptions import AirflowException

import utils
from utils import (
Expand Down Expand Up @@ -60,6 +61,10 @@ def launch_file_reindex(**kwargs):
response.raise_for_status()
except http.client.HTTPException as he:
print(f'Error {he}')
except AirflowException as ae:
print(f'Error {ae}')
except Exception as e:
print(f'Broad Exception {e}')

t_launch_file_reindex = PythonOperator(
task_id='launch_file_reindex',
Expand Down
1 change: 1 addition & 0 deletions src/ingest-pipeline/airflow/plugins/hubmap_api/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
NEEDED_ENV_VARS = [
'AIRFLOW_CONN_INGEST_API_CONNECTION',
'AIRFLOW_CONN_UUID_API_CONNECTION',
'AIRFLOW_CONN_FILES_API_CONNECTION',
'AIRFLOW_CONN_SEARCH_API_CONNECTION',
'AIRFLOW_CONN_ENTITY_API_CONNECTION'
]
Expand Down
1 change: 1 addition & 0 deletions src/ingest-pipeline/misc/tools/airflow_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ source source_platform_file.sh
envvars=( CONFIG HOME \
CONN_INGEST_API_CONNECTION \
CONN_UUID_API_CONNECTION \
CONN_FILES_API_CONNECTION \
CONN_CELLS_API_CONNECTION \
CONN_SEARCH_API_CONNECTION \
CONN_ENTITY_API_CONNECTION \
Expand Down

0 comments on commit 96e3be7

Please sign in to comment.