actually, shouldn't it be:

```
if 'topic' in test \
    and hasattr(test['topic'], 'error') \
    and test['topic'].error is not None:
```