Move error to own module

Splits common into smaller modules