Add error type in error message object and remove rule.type in types messages