Refactored error module.

Now takes IAttributeReader in order to locate the error index.