Moved errors to separate file to inclusion elsewhere, and cleanup of the transformers error handling