attach error pattern to entity