CatalaLang/catleg

Improve error messages for expired articles

denismerigoux opened this issue · 0 comments

When running :

catleg check-expiry ~/catala/examples/aides_logement/code_construction_reglementaire.catala_fr

With ~/catala containing the master branch of the Catala repo, I get the following output :

/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000038878991' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985814'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000038878933' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985801'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000038878653' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985424'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000038878601' has expired (on 2023-04-05). It has been replaced by 'LEGIARTI000038878601'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000041419283' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985786'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000038878579' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985420'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000044636782' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985799'.
  warnings.warn(
/home/denis/catala/_python_venv/lib/python3.11/site-packages/catleg/check_expiry.py:36: UserWarning: Article 'LEGIARTI000044636786' has expired (on 2023-09-01). It has been replaced by 'LEGIARTI000047985795'.
  warnings.warn(

These error messages are not really legible. We don't need to see where in the catleg Python code the warning has been raised, but we need to see where in the Catala source code the expired article is.