astronomer / dag-factory

Dynamically generate Apache Airflow DAGs from YAML configuration files
Apache License 2.0
1.21k stars 182 forks source link

Review broad Exception and remove this pattern, where possible #257

Open tatiana opened 1 month ago

tatiana commented 1 month ago

DAG Factory captures broad exceptions in many places, which makes it quite hard to troubleshoot issues:

(venv) ➜  dag-factory git:(fmain) # grep -rn "except Exception" dagfactory
dagfactory/dagbuilder.py:150:        except Exception as err:
dagfactory/dagbuilder.py:296:        except Exception as err:
dagfactory/dagbuilder.py:300:        except Exception as err:
dagfactory/dagbuilder.py:317:        except Exception as err:
dagfactory/dagbuilder.py:561:        except Exception as err:
dagfactory/utils.py:33:    except Exception as err:
dagfactory/dagfactory.py:74:        except Exception as err:
dagfactory/dagfactory.py:111:            except Exception as err:
dagfactory/dagfactory.py:207:        except Exception:  # pylint: disable=broad-except

The goal of this PR is to address this, removing this pattern where possible.