pytroll / pytroll-collectors

Collector modules for Pytroll
GNU General Public License v3.0
3 stars 19 forks source link

Catch KeyError from collector from missing TLE #116

Closed TAlonglong closed 2 years ago

TAlonglong commented 2 years ago

Now and then I get for some reason an exception as described in #30

What happens is then that the subscriber for this area stops and thus can not continue collecting new segments. Other regions continue to work if there are more. Or the the geographic gatherer just continue to run.

One way to handle this, as proposed in this PR, is to catch the KeyError exception and then continue keeping the subscriber running. Therefore at the next run it will try again and it will still work.

I think this is better than just stop working. At least it tries again.

Another way is to do this is to make the whole geographic gatherer stop and then leave to the user how he or she will handle this. But this will affect all the regions in the gatherer.

codecov[bot] commented 2 years ago

Codecov Report

Merging #116 (3deb327) into main (84b4dc0) will increase coverage by 0.25%. The diff coverage is 100.00%.

:exclamation: Current head 3deb327 differs from pull request most recent head b280d7f. Consider uploading reports for the commit b280d7f to get more accurate results

@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
+ Coverage   89.58%   89.84%   +0.25%     
==========================================
  Files          25       25              
  Lines        3611     3653      +42     
==========================================
+ Hits         3235     3282      +47     
+ Misses        376      371       -5     
Impacted Files Coverage Δ
pytroll_collectors/tests/test_region_collector.py 96.96% <100.00%> (+0.22%) :arrow_up:
pytroll_collectors/tests/test_triggers.py 100.00% <100.00%> (ø)
pytroll_collectors/triggers/_base.py 83.84% <100.00%> (+4.31%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.