krioukov/LoCalProjects — Issue #3: Enphase sMAP error handling
Author: krioukov
Created: 2012-01-28 17:26:08+00:00
State: open

You already catch most of the common exceptions, which is great, but when we run this over long periods of time all kinds of unexpected stuff will happen. For example we have seen partial/corrupt pages being returned by web servers. We want to make sure these transient errors dont kill the read loop, but we want to know about them in case say the server data format changed.

Suggestions:
1) I suggest wrapping each iteration of the the for loop on line 59 in a try, except Exception and logging the error.
2) Everywhere, instead of printing errors / exceptions directly use logging. E.g.
```
import logging
try:
...
except Exception, e:
logging.exception(e)

logging.error(foo)
```